Community discussions

MikroTik App
 
alphahawk
Member Candidate
Member Candidate
Topic Author
Posts: 101
Joined: Fri Mar 28, 2008 6:40 pm

Routing different lans through different wans (Sanity Check)

Thu Aug 02, 2012 11:27 pm

I have a setup where we have a t1 connection on ether1 and a cable connection on ether 2. There is then 1 Lan setup on ether3 and 2nd Lan on ether4.

I am trying to setup the router so that ether3 routes out the t1 and ether4 to go out the cable. On top of this if either connection fails it falls over.
#wan
/ip address add address=10.0.1.2/24 interface=ether1
/ip address add address=10.0.2.2/24 interface=ether2

#lan
/ip address add address=192.168.1.1/24 interface=ether3
/ip address add address=192.168.2.1/24 interface=ether4

/ip route add gateway=10.0.1.2
/ip route add gateway=10.0.2.2 distance=10

/ip firewall nat add action=masquerade chain=srcnat comment="" disabled=no

What I then usually do is use a route mark for each local subnet and then in the route list I add the routing mark for the route. It seems to work sometimes and other times not. Is there a better way to do it?

Thanks
 
vk7zms
Member Candidate
Member Candidate
Posts: 227
Joined: Thu Jun 29, 2006 3:01 am
Location: Hobart, Tasmania
Contact:

Re: Routing different lans through different wans (Sanity Ch

Fri Aug 03, 2012 12:37 am

routing marks are the way to do it - your masq rule "may" be causing trouble as it will masq everything - even one LAN to the other..

I would try using two rules, one for each LAN, and specify the src-address as the LAN address and dst-address !other LAN address