Community discussions

MikroTik App
 
Kristijan
just joined
Topic Author
Posts: 10
Joined: Wed Mar 13, 2013 8:11 pm

2 Wan - 2 Lan

Thu Apr 25, 2013 3:40 pm

I have some problem. I have 2 LAN and 2 WAN as picture below:

Image

As you can see LAN 1 will use WAN 1 and LAN 2 will use WAN 2. But I cant connect between these 2 LANs. Here is my configuration:
/ip firewall mangle
add action=mark-connection chain=prerouting disabled=no new-connection-mark=wan1 passthrough=yes src-address=192.168.0.0/24
add action=mark-routing chain=prerouting connection-mark=wan1 disabled=no new-routing-mark=wan1 passthrough=yes src-address=192.168.0.0/24

add action=mark-connection chain=prerouting disabled=no new-connection-mark=wan2 passthrough=yes src-address=192.168.1.0/24
add action=mark-routing chain=prerouting connection-mark=wan2 disabled=no new-routing-mark=wan2 passthrough=yes src-address=192.168.1.0/24


/ip firewall nat
add action=masquerade chain=srcnat disabled=no src-address=192.168.0.0/24
add action=masquerade chain=srcnat disabled=no src-address=192.168.1.0/24


/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.10.10.1 routing-mark=wan1 scope=30 target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.1.1.1 routing-mark=wan2 scope=30 target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.10.10.1 scope=30 target-scope=1
What should I do to connect between these 2 LAN. Your thought and advise is highly appreciated. Thank you!
 
muxure
just joined
Posts: 16
Joined: Mon Oct 24, 2011 11:18 am

Re: 2 Wan - 2 Lan

Fri Apr 26, 2013 2:15 am

You will need to add some routing rules.

Winbox
IP>Routes>Rules

Src-Address: 192.168.0.0/24
Dst-Address: 192.168.1.0/24
Routing Mark: WAN1
Action: Lookup
Table: Main

And vice versa.
 
Kristijan
just joined
Topic Author
Posts: 10
Joined: Wed Mar 13, 2013 8:11 pm

Re: 2 Wan - 2 Lan

Fri Apr 26, 2013 3:22 pm

Thanks brother did it and now I can pinging between interfaces.
Src-Address: 192.168.0.0/24
Dst-Address: 192.168.1.0/24
Routing Mark: WAN1
Action: Lookup
Table: Main
Src-Address: 192.168.1.0/24
Dst-Address: 192.168.0.0/24
Routing Mark: WAN2
Action: Lookup
Table: Main
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1076
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: 2 Wan - 2 Lan

Fri Apr 26, 2013 3:44 pm

When using policy routing, as a general rule: the most specific route will take over the other routes.
In your case, you have a policy routing which forces the 192.168.0.0/24 network to use 10.10.10.1 as gateway, as a result, the connected routes will not work.
So, you should exclude the traffic between the two networks from policy routing:
/ip firewall mangle
add chain=prerouting src-address=192.168.0.0/24 dst-address=192.168.1.0/24 action=accept
add chain=prerouting src-address=192.168.1.0/24 dst-address=192.168.0.0/24 action=accept
Put the above rules before/above the other mangle rules. It should do it.
 
Kristijan
just joined
Topic Author
Posts: 10
Joined: Wed Mar 13, 2013 8:11 pm

Re: 2 Wan - 2 Lan

Sun Apr 28, 2013 1:51 am

@Caci99 now i can't ping betwen 192.168.0.1 / 192.168.1.1...
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1076
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: 2 Wan - 2 Lan

Sun Apr 28, 2013 1:34 pm

@Caci99 now i can't ping betwen 192.168.0.1 / 192.168.1.1...
You can or can't? Because you couldn't in first place.
 
Kristijan
just joined
Topic Author
Posts: 10
Joined: Wed Mar 13, 2013 8:11 pm

Re: 2 Wan - 2 Lan

Sun Apr 28, 2013 2:03 pm

I put it in the first place but I can not pinging between interfaces ...
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1076
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: 2 Wan - 2 Lan

Sun Apr 28, 2013 10:04 pm

On the mentioned mangle rules, do the counters run? Are they capturing any traffic?
 
Kristijan
just joined
Topic Author
Posts: 10
Joined: Wed Mar 13, 2013 8:11 pm

Re: 2 Wan - 2 Lan

Mon Apr 29, 2013 1:11 am

Yes.
 
logiqit
just joined
Posts: 18
Joined: Thu Jun 09, 2011 5:38 pm

Re: 2 Wan - 2 Lan

Thu Dec 19, 2013 10:26 am

I am in a similar situation, did this ever get resolved, and in that case how?

Thank you.
 
User avatar
Kreacher
Member
Member
Posts: 359
Joined: Wed Sep 25, 2013 3:58 pm
Location: Hogwarts

Re: 2 Wan - 2 Lan

Fri Dec 20, 2013 9:53 pm

Hello Kristijan,

please try out load balancing in combination with policy based routing in combination with
setting up VLANs in your case it would bring in my eyes the most effect and effort.