Community discussions

MikroTik App
 
ondrej22
just joined
Topic Author
Posts: 7
Joined: Sun May 29, 2016 11:37 pm

2 gateways for different LAN

Wed Jun 08, 2016 10:08 pm

Hi,

please help with this problem.
I have 2 routes set for gateways:
/ip route
add distance=1 gateway=192.168.1.1
add distance=1 gateway=192.168.1.2 routing-mark=2nd_ISP

/ip firewall mangle
add action=mark-routing chain=prerouting in-interface="Bridge HOTSPOT" new-routing-mark=2nd_ISP

/ip address 
add address=192.168.77.1/24 interface="Bridge HOTSPOT" network=192.168.77.0
add address=192.168.1.7/24 interface="Bridge PRIVATE" network=192.168.1.0

/ip route print 
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit 
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 A S  0.0.0.0/0                          192.168.1.1               1
 1   S  0.0.0.0/0                          192.168.1.2               1
 2 ADC  192.168.1.0/24     192.168.1.7     Bridge PRIVATE            0
 3 ADC  192.168.77.0/24    192.168.77.1    Bridge HOTSPOT            0

The problem is, that route for 2nd ISP stays inactive (blue).

Where is the problem?
Thank you
 
ondrej22
just joined
Topic Author
Posts: 7
Joined: Sun May 29, 2016 11:37 pm

Re: 2 gateways for different LAN

Thu Jun 09, 2016 11:35 pm

There is a strange wa how to fix it.
If I change the routing mark at route and firewall mangle to different name, the route starts to work.
If I restart the mikrotik, the route stops working (turns blue) and I have to change mark to different name...

Wierd...
 
thenoob
just joined
Posts: 22
Joined: Wed Mar 27, 2013 2:23 am

Re: 2 gateways for different LAN

Fri Jun 10, 2016 1:09 am

you cant have 2 default routes .
what you can do is packet mangling and changing the gateway address based on a policy
this is commonly refered to "policy based routing"
 
ondrej22
just joined
Topic Author
Posts: 7
Joined: Sun May 29, 2016 11:37 pm

Re: 2 gateways for different LAN

Sat Jun 11, 2016 12:31 am

Will you please help me with correct setup?
Thank you a lot - I am novice...

Who is online

Users browsing this forum: kristovskis, salar2714 and 14 guests