jaclaz
April 25, 2025, 12:32pm
6
/ip/route/print
Flags: D - DYNAMIC; A - ACTIVE; c - CONNECT, s - STATIC
Columns: DST-ADDRESS, GATEWAY, DISTANCE
# DST-ADDRESS GATEWAY DISTANCE
;;; primary_route
0 As 0.0.0.0/0 124.1.2.2 1
;;; secondary_route
1 s 0.0.0.0/0 10.31.0.2 2
DAc 10.31.0.0/29 ether4 0
My failover script changes the route distance on ether2 to ‘3’ enabling the default route via ether4. I was hoping I could use ping 8.8.8.8 interface=ether2 to periodically check if the primary WAN was back up but my testing (I am currently testing around the other way, that is, try gin to ping out via ether4) shows that this will not work.
But nothing prevents you from adding a “narrow” /32 route via ether4 for the chosen address (since 8.8.8.8 is more widely used, better IMHO 8.8.4.4 for this use or another DNS server).
Check this other (simpler) approach:
http://forum.mikrotik.com/t/simpler-failover-for-two-gateways-i-found-working/169108/1
http://forum.mikrotik.com/t/simpler-failover-for-two-gateways-i-found-working/169108/1