I know the MT prescribed way to implement a WAN failover is to implement the ‘check gateway’ parameter and then have an additional default route with a greater distance.
Is there any way to implement this with a dynamic default route as the DHCP client creates this route automatically other than creating a script?
…meaning, that if I have 2 dynamic ip ISP connections, I have no good way of setting up failower?
All I see is setups with static ip’s and thet is not an option - at least backup ip is dynamic for me…
Under DHCP Client, Remove (uncheck) Default Route for each DHCP WAN connection. (Just make note what the actual Default Route is for each WAN Connection under IP Route first).
Setup your own default route for each connection under IP Route.
Another way that is working for me is to also uncheck “add default route” in the DHCP client entry and instead add a static route of 0.0.0.0/0 with a distance of 1 for your preferred interface and the same static route with a different distance pointed to the next preferred interface.
Just use the interface as the gateway instead of an IP. This way if your provider renumbers, you dont have to reconfigure.
Does anybody have a solution if the gateway is your local modem, and although it is on and working, the cable company cut the internet for some reason, so it could ping the gateway but has no internet? Instead of a ping check on the gateway, is there a way to ping some internet source like a DNS server?
I wrote a script that handles this. I don’t know that it’s better than the linked stuff - I haven’t looked at it.
However, it does several things I find useful.
Rather than simply up if any pings return, you can set the level of packet-loss that should result in a “practically” down pipe.
You can ping ANY IP/host - not just the gateway - which helps with the loss being upstream. [Just pick the IP/Host carefully - you’d like that host to be as good an indicator of problems as possible.
-Too far away and you’ll drop the pipe when nothing’s wrong, only the route to that host.
-Too close, and you’ll still get to it when there are peering problems, for example - so it will keep the pipe “up” when things are really down.
This actually works… You don’t need any routing marks. Making two recursive gateways is enough to do the job. However, this was meant to be used with fixed IP addresses but even if Your ISP gives You a dynamic address, gateway will be the same in most cases. I made some test enviroment and tested this and it works just fine. I even configured a netwatch to send me an email when the main internet line is broken. Here is the screenshot so You can see how does it look like.
Best Regards.