Attempting to evolve from caveman's failover

Hi,
from what I understood:

  • Clients have FIXED IPs (and FIXED Gateway-IPs)
  • Three Internet-Gateways are in place, all of them with DIFFERENT IPs
  • Caveman is plugging cables when failover should happen

I would totally redesign this network in order to:

  • If DHCP is not possible, use MIKROTIK-Router-IP as Gateway
  • Attach ALL Internet-Gateways and clients to MikroTik, they need valid IPs in your subnet
  • Create the failover-logic on your MikroTik for those three gateways

The last point is more generic, since it depends on how detailed you’re in topic and want to be.
The easiest way to create a failover would be to create three standard routes (0.0.0.0/0) with different routing costs / distance.
The lowest distance count route will be used unless it is unreachable.

This means: The GATEWAY needs to be unreachable / turned off in order to get the next distance as the active route.
But you would also be able to ALTER the routing distance to make an alternative route active, instead of (un-)plugging cables.

If you want to make sure, alternative (say: “backup”-) routes become active automatically, you would need to go into the “recursive routing for failover”-tutorial (which you can find here: https://help.mikrotik.com/docs/pages/viewpage.action?pageId=26476608 ) or use another approach involving NETWATCH and MANGLE-Rules for firewall I once mentioned here: http://forum.mikrotik.com/t/simpler-failover-for-two-gateways-i-found-working/169108/1

As this being said - it’s only meant as an example. We do not know your configuration for sure and there may also be some other things to consider.

Hope this will help you evolve from caveman to network-hero :slight_smile:


edit
As I read later on - ALL Internet-Gateways have 192.168.1.1 and you’re not able to change? The above solutions require each gateway to have a unique IP in your network and having the MikroTik to have the 192.168.1.1

If it is the case that ALL GATEWAYS have 1.1. and you are not able to change the interal addresses you can solve this manually:

  • Connect all Gateways to a MikroTik
  • DISABLE LAN-Ports of GW2 and GW3 (better do that before Step1 :wink: )
  • In case of failing Internet: DISABLE LAN-Port of GW1 and ENABLE GW2 or GW3
  • No need to create differnt standard-routes (since 192.168.1.1 will be the way to go either Gateway used)

Of course, this could also be scripted with MANGLE-Rules and NETWATCH-Tool on a MikroTik, as well. Automatic Failover is quite easy to do (Netwatch, Probe 8.8.8.8 for Ping, if not responding, deactivate Port for GW1, activate Port for GW2, probe again, if not responding in a given time, deactivate Port for GW2, activate Port for GW3…), automatic failback is another story since we’re not able to probe the preferred route for connectivity. For this you would surely need to change the internal addresses of the Gateways.

That brings me to a rarely stupid workaround…
IF you have access to the Gateways and IF you are able to create a DynDNS-Host for them to… let’s say probe them “from outside” with DynDNS or equal, the MikroTik would be able to check every Internet-Connection with the corresponding DynDNS-Host from inside. You’ll need to make sure to refresh DNS-Cache if your Internet-IPs are subject to change. If you have FIXED-IPs, great, probe them. But with this idea, it would be possible to create a failback if GW1 is responding to DynDNS again.

Best regards,
Martin!