Things would be so much easier if I could set netwatch to use a specific interface.
Setting up a useful failover script for dynamic WANs would be cake!
Things would be so much easier if I could set netwatch to use a specific interface.
Setting up a useful failover script for dynamic WANs would be cake!
Very easy to do, doesn’t even require Netwatch or scripting.
Simplest form of failover when using DHCP-client on multiple WAN interfaces… use the default-route-distance option in /ip dhcp-client. Make all clients have unique values and in order from lowest (most preferred) to highest (last resort). If using PPPoE on one and DHCP on the others, remember that PPPoE default routes are added with a distance of 1 and this cannot be changed. If you want to make the PPPoE route less than the highest priority, utilize the routing package and create a route filter as such (change X to the desired distance):
/routing filter add action=accept chain=dynamic-in distance=1 set-distance=X
Using routing filters, I even set-routing-mark on all of my dynamically learned gateways and then mangle the traffic so some traffic always goes over a certain provider unless it fails, other traffic might be load balanced, and some traffic may only be allowed to go over a certain provider and NOT have the option to fail over.
To answer your question directly though, choose unique internet addresses that you expect to always be up and that you will never need to failover (such as your providers DNS servers (I like to use public DNS servers such as 8.8.4.4, 8.8.8.8, 4.2.2.1, 4.2.2.2, 4.2.2.3, 4.2.2.4, 4.2.2.5, 4.2.2.6) then just create static routes to them over one of your providers. Subsequently, if you Netwatch the IP that is statically routed over provider1, you know that provider1 went down or up.