Community discussions

MikroTik App
 
joooooooohns
just joined
Topic Author
Posts: 12
Joined: Thu Sep 06, 2018 8:49 am

need help with simple failover

Sat Sep 22, 2018 10:41 pm

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?
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 209
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: need help with simple failover

Sun Sep 23, 2018 1:02 am

set eth1 distance=1
set eth2 distance=2
done :wink:
 
mducharme
Trainer
Trainer
Posts: 1777
Joined: Tue Jul 19, 2016 6:45 pm
Location: Vancouver, BC, Canada

Re: need help with simple failover

Sun Sep 23, 2018 1:35 am

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?
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.
 
joooooooohns
just joined
Topic Author
Posts: 12
Joined: Thu Sep 06, 2018 8:49 am

Re: need help with simple failover

Sun Sep 23, 2018 5:02 am

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)
 
mducharme
Trainer
Trainer
Posts: 1777
Joined: Tue Jul 19, 2016 6:45 pm
Location: Vancouver, BC, Canada

Re: need help with simple failover

Sun Sep 23, 2018 5:28 am

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.
 
joooooooohns
just joined
Topic Author
Posts: 12
Joined: Thu Sep 06, 2018 8:49 am

Re: need help with simple failover

Sun Sep 23, 2018 2:31 pm

works!
thank you for your help
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19380
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: need help with simple failover

Tue Oct 09, 2018 5:08 pm

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.

Who is online

Users browsing this forum: Airiasas, Benzebub, fxcd and 27 guests