Hi, I’m pretty fresh to the Mikrotik scene (only started working with them seriously a few months ago) and most of it is still pretty mysterious to me. I’ve done a lot of Googling and also searched the forums, but I can’t find what I’m looking for. My scenario:
My customer has an internet connection that runs on a wireless Ubiquiti link, with a 3G / LTE failover. However, they currently have to do the failover manually when the wireless link goes down (plug the dongle in and out) and they don’t like it that way. I’ve been trying to get a Mikrotik failover to work with one of the wAP devices (the one with a SIM slot that almost looks like a Nanostation Loco), but for the life of me I can’t get the failover to work properly. If the LAN is physically disconnected, or the PPPOE session is blocked, the failover works, but that’s it. Even though it’s set to ping Google (using Netwatch), it doesn’t switch gateways when the internet connection goes down. Any ideas?
You forgot to include your configuration, so it is difficult to tell what is wrong with it.
But in general, doing failover using ping and reacting on failures of ping reply is always a little tricky!
Remember you will need to use an IP address that you are not using in regular use, so using Google’s DNS is only OK when you are not using it for DNS lookups.
You will need to add a fixed route for the IP address via your primary connection, or else it will also route via your fallback link and the pings will return immediately when you switch to fallback, causing a switch back to the primary which is down.
Also it is difficult to work with netwatch because it does not have any failure thresholds. A single failed ping will cause the “on down” event to be triggered, so packet loss on your wireless link will immediately cause a switchover. You probably don’t want that.
It requires quite some scripting with additional checks using /ping instead of only netwatch to make a reliable switchover mechanism this way.
It may be better to just use a “check-gateway=ping” on your primary link and have the default route via your 3G stick at a higher distance (set it in the DHCP client).
That will not work perfectly either, but at least it does not require so much programming in MikroTik scripting language, which is quite difficult to debug and get right.
Thanks for the response, you’ve already cleared up more than you might realize. I’m not a slow learner, but due to the complex nature of Mikrotik scripting I’ve been battling a bit (no official training, I’m just learning as I go). I would have responded sooner but life tends to get in the way… Going to set up the whole thing now and see if I can get something to work the way I want it to.