search tag # rextended dual dhcp wan failover
This works only on 6.46.8+ and not in v7+
REMEMBER TO REMOVE “ADD DEFAULT ROUTE” ON DHCP CLIENTs
and add those scripts on “script” section of DHCP client
script for DHCP Client 1 = MAIN
/ip route
set [find where comment~"ISP1"] gateway=$"gateway-address"
script for DHCP Client 2 = FAILOVER
/ip route
set [find where comment~"ISP2"] gateway=$"gateway-address"
This must be pasted on new terminal, better if before do that remove all non dynamic routes from routes
DO NOT CHANGE COMMENTS!!! (until keeped ISP1 and ISP2 inside…)
First time change 2.3.4.5 and 6.7.8.9 with actuals or, after paste on new terminal, disable and re-enable dhcp clients
/ip dns
set servers=1.1.1.1,8.8.8.8
/ip route
add comment="A - 1.1.1.1 must be reachable only from ISP1" distance=1 dst-address=1.1.1.1/32 gateway=2.3.4.5 scope=10
add comment="B - Recursive Routing, check ping 1.1.1.1 instead of ISP IP" distance=10 gateway=1.1.1.1 check-gateway=ping
add comment="C - ISP2 is alternative Gateway" distance=20 gateway=6.7.8.9