If one route stopped

i have 4 dsl lines, if one or route stopped how redirect to second route or third…

many thx

Hi,

/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out1
add disabled=no distance=3 dst-address=0.0.0.0/0 gateway=pppoe-out2
add disabled=no distance=5 dst-address=0.0.0.0/0 gateway=pppoe-out3
add disabled=no distance=7 dst-address=0.0.0.0/0 gateway=pppoe-out4

not working?

working for me …

how goes the line from gateway=192.168.1.1 to gateway=192.168.2.1
if 192.168.1.1 stopped

route with 192.168.1.1 will become invalid, so next valid route (based on distance) will be used …
You need to post more details:

One route will not go invalid by itself (except when the physical line goes down). Something must check it: http://wiki.mikrotik.com/wiki/Two_gateways_failover.
For my own network scenario the check-gateway is doing more than just checking a gateway and disabling that very same route (my alternate gateway is not connected to the same router, but at other side of the internal network using the same physical network interface as default gateway would), so I am unable to use it and use some additional scripting around it.

Hi,

In the case of having two modems plugged into a 750G and the dsl only going down the check gateway will not work, hence I wrote this small script that is combined with pcc, and it works well in our setups. Hope it helps, any input welcome.

:global ping1 [/ping 192.168.2.1 count=3 routing-table=ether1_traffic]
:global ping2 [/ping 192.168.3.1 count=3 routing-table=ether2_traffic]
:global gw1 [/ip route get number=0  gateway-status]
:global gw2 [/ip route get number=1  gateway-status]

:if (($ping1=0) && ($ping2=3) && ($gw1="192.168.2.1 reachable ether1")) do={/ip route disable numbers=[find gateway=192.168.2.1];  [:log info  "disabling route 2.1"];}
:if (($ping1=3) && ($ping2=3) && ($gw1!="192.168.2.1 reachable ether1")) do={/ip route enable numbers=[find gateway=192.168.2.1]; [:log info  "enabling route 2.1"];}

:if (($ping1=3) && ($ping2=0) && ($gw2="192.168.3.1 reachable ether2")) do={/ip route disable numbers=[find gateway=192.168.3.1];  [:log info  "disabling route 3.1"];}
:if (($ping1=3) && ($ping2=3) && ($gw2!="192.168.3.1 reachable ether2")) do={/ip route enable numbers=[find gateway=192.168.3.1]; [:log info  "enabling route 3.1"];}

:if (($ping1=0) && ($ping2=0)) do={[/ip route enable numbers=[find gateway=192.168.2.1]]; [/ip route enable numbers=[find gateway=192.168.3.1]]; [:log info  "fail safe enabling 2.1 and 3.1"];}

PJD

Actually, I can not use PING for gateway checking as my ISP will selectively filter out ICMP echo requests in case of “network overload” and they insist that PINGing the default gateway for network condition checking is bad thing to have. Strange as it may sound, but who am I to argue with them. So, I did it a bit differently:

  1. Set the NetWatch to check the default gateway being up or down and just setting the status of it as a value of a global variable;
  2. Scheduler will periodically store received byte count of that gateway interface and perform default route switchover only if these numbers match over two successive runs plus at the same time NetWatch reports as that default gateway being down as well.

I’ve yet to test it all out, but it should work.

and what about ARP:
/ip route add disabled=no distance=1 dst-address=0.0.0.0/0 gateway= check-gateway=arp