I kow it has been accomplished by moving gateway metrics, but i am looking for a basic failover method.
I have a main (cable) and a backup (cellular) connection. I am looking to script a ping every 5 seconds or so that looks to the outside world say google, if that fails, it will switch to the backup connection.
The only examples I see ping the gateway, I have tried this but been unsuccessful, perhaps I am doing it wrong.
By assigning to every interface a route and then routing traffic through it with different metric. That actually works.
By applying VRRP, different solution - equal result.
But the question that seems that no one can answer is: How to do a smart failover checking link quality?
I have a similar issue, i’m having 3 differents WAN but it always chooses that one that have the lowest metric, and can’t choose the one with the best performance.
I mean, if i have 80% loss over number 1 metric - Traffic goes over there anyway.
I am currently doing mangle fail over but the issue seems to be it will only failover if my modem or gateway is not reachable, I need a script that will ping the outside world. (i.e Google or nist)
Wan1 is a cable modem
Wan2 is a cellular backup.
Most of my outages have been beyond the node gateway of the cable company. because the Mtik can see the cable modem gateway it doesn’t redirect the metric.
So... when you send any request to 8.8.8.8 it will be always by the GW BK. Then you have to set 8.8.8.8 as a Gateway (to get a reference IP) and you can now set check-gateway=ping
That is a homemade and easy way, but i recommend you to read about vrrp that is what you need to apply in this scenario.