need help with simple failover

hello, i need some help with simple failover..

eth1 is the normally used internet connection
eth2 is connected with a lte router

now i like to use the lte router as failover connection..
in routes i can configure “check gateway” - but what will happen if my gateway on eth1 is reachable but the connection of my carrier isn’t ok?

i think i’ve to use a script or netwatch..
can anybody help me how to make a simple failover?

set eth1 distance=1
set eth2 distance=2
done :wink:

Then it won’t know it is down. You can use recursive routing as a workaround (replace you.rga.tew.ay below with your default gateway IP on ether1):

/ip route
add distance=1 gateway=8.8.8.8 check-gateway=ping
add dst-address=8.8.8.8 gateway=you.rga.tew.ay scope=10

That way if google DNS fails to ping through ether1 it will fail over to LTE.

Ah ok, thank you very much..
I already googled a solution like that but wasn’t sure if this additional route will effect the “main” route (to 0.0.0.0/0)

/ip route add distance=1 gateway=8.8.8.8 check-gateway=ping

is the same as:

/ip route add dst-address=0.0.0.0/0 distance=1 gateway=8.8.8.8 check-gateway=ping

So you would get rid of your existing default route (to 0.0.0.0/0 through ether1) and replace it with that. If the existing default route through ether1 is received through DHCP then you will need to disable adding the default route in the DHCP client settings.

Then, the other route needs to be added to explain how to get to the fake “gateway” 8.8.8.8 (otherwise you won’t actually have connectivity):
/ip route add dst-address=8.8.8.8 gateway=you.rga.tew.ay scope=10

If your ether1 IP is received through DHCP and it is possible that your default gateway might change though ether1, you might need to script the update of that route in the DHCP client. If your ether1 IP is static, or the gateway is always the same, that is not necessary.

Leave your LTE default route in place, just set it for a distance greater than 1 (ex. 2, or 3, or whatever you wish)

If you want or need to do a similar ping test for the LTE gateway it is possible, but I’m guessing it isn’t necessarily since the LTE is really a fall-back anyway.

works!
thank you for your help

The nice part is the router will continue to check the main WAN (eth1), while using the LTE connection, and if and when it becomes available will automatically shift back to it.