Have another WAN as a backup

Greetings, friends, there is the possibility of creating a script to monitor my first WAN and I have a second WAN as a backup, be careful but I don’t want it balancing, the second WAN I want as a backup, so that when the first WAN is deactivated it begins to work the second WAN, I hope you understand me.



AXELELEMENT.

No need to use scripting for this, WAN failover can be handled using route distance.

If your WAN is currently injecting a default route into your table - disable this and add a static default route for each WAN using it’s IP as the gateway.

Increment the routes depending on which is primary, secondary, etc., e.g.

Primary WAN - Route distance 1
Secondary WAN - Route distance 2
etc.

When the primary WAN loses connectivity, the next usable default route will be used.

ok, but would both of them be working at the same time?

Both WANs will be online and connected, but should not be doing any load-balancing. Also I should say the solution I mentioned only fails over if the gateway itself is unreachable (not the internet). For a more in-depth solution see here: http://forum.mikrotik.com/t/daul-wan-with-failover/128515/1

If you’d prefer to enable and disable the WANs depending on which is online I would recommend using the Netwatch tool: https://wiki.mikrotik.com/wiki/Manual:Tools/Netwatch

You can use it to ping the gateway of each WAN and run scripts accordingly, or you can ping out to a general IP such as 1.1.1.1 or 8.8.8.8 (similar to the forum post above) and use scripting to check which interface is enabled, disable it and enable the other. I’m currently using something similar for an L2TP tunneling network I have setup over multiple sites with multiple WAN Interfaces and providers.

Possible with some simple if/do commands - more info here: https://wiki.mikrotik.com/wiki/Manual:Scripting