Recursive Failover (Checks the Internet, Not Just the Modem)
Switch ISPs when the internet is down even while the modem/gateway is still up, with no script, on v6 and v7.
Each ISP gets one public IP as a marker that may only be reached through that ISP. The default route uses the marker IP as its gateway (recursive) with check-gateway=ping, so it pings the internet, not the modem. A blackhole route keeps the marker from going out through another ISP while its own is down. v6 and v7 differ in how the blackhole is written.
- Remove the old default route first (WAN DHCP client: add-default-route=no) so it does not clash.
- Do not use a marker IP as the router's DNS: when its ISP is down, that DNS is unreachable too. Use another IP for DNS.
- Check /ip route: the Failover ISP1 route must be active (A) and its gateway shown as recursive via the ISP1 gateway. Test by unplugging the modem's internet line (not the cable to the router).
- For a PPPoE ISP, put its interface name as the gateway (pppoe-out1).
How to use: Copy the script, open Winbox → New Terminal, paste. Or Download .rsc, upload it in Files, then run /import file-name=failover-recursive.rsc.
RouterOS v6 / v7 · added 11 November 2026
readyRouterOS v6 / v7
Terminal <failover-recursive>
More in Routing & Failover