Community discussions

MikroTik App
 
nemo42za
just joined
Topic Author
Posts: 6
Joined: Wed Nov 21, 2018 1:28 pm

Failover between three Mikrotik routers

Thu Sep 26, 2019 3:39 pm

Good day,

I have setting up a failover between three Mikrotik routers. Router1 is the main router where the internet comes into the environment and the other two routers are connected to Router1. They're all communicating with each other as their's no firewall NAT rules in place.

Each of the routers are installed in different buildings, have their own set up servers and pc and run independently from each other.
Router1 = Main Building
Router2 = Building2
Router3= Building3

I need to setup a failover, so that if the connection between Main Building (Router1) and Building 2 (Router2) breaks for whatever reason, the traffic to Building1 should be routed via Router3 as a failover and vice versa. Is this possible, and if so, what type of config will I need in order to achieve this? There is a link between Router2 and Router3, which can be connected to another eth port.

I did look up on how failover on Mikrotik works, but nothing I can find on the internet explains my type of situation, where most instructions talk routing to a different ISP using masquerade rules and so on.

I want to share my current configs, but not sure how to export it into a readable format for the forum

Thanks for any help or insight in advance.
 
User avatar
xvo
Forum Guru
Forum Guru
Posts: 1237
Joined: Sat Mar 03, 2018 1:12 am
Location: Moscow, Russia

Re: Failover between three Mikrotik routers

Thu Sep 26, 2019 4:00 pm

You need additional set of routes on each of the routers with a higher distance than the direct ones.

For example on r2 you have a route to r1 via interface1 and to r3 via interface2 with distance 0.
Now you need to add routes: to r1 via r3 address, and to r3 via r1 address with distance >0.
And this way on all three.
 
Mendez4
just joined
Posts: 1
Joined: Fri Sep 27, 2019 10:50 am

Re: Failover between three Mikrotik routers

Fri Sep 27, 2019 10:51 am

Let us suppose that we have several WAN links, and we want to monitor, whether the Internet is accessible through each of them www.upsers.com The problem can be everywhere. If your VPN cannot connect - then there's no problem, your default route with gateway=that-vpn-connection will be inactive.
Last edited by Mendez4 on Sat Sep 28, 2019 1:13 pm, edited 1 time in total.
 
nemo42za
just joined
Topic Author
Posts: 6
Joined: Wed Nov 21, 2018 1:28 pm

Re: Failover between three Mikrotik routers

Fri Sep 27, 2019 11:36 am

You need additional set of routes on each of the routers with a higher distance than the direct ones.

For example on r2 you have a route to r1 via interface1 and to r3 via interface2 with distance 0.
Now you need to add routes: to r1 via r3 address, and to r3 via r1 address with distance >0.
And this way on all three.
Thanks for the reply. What would my address and gateway for the failover be if my current config is as follows:

Router1 IP = 10.0.100.1
Router2 IP = 10.0.100.2 GW = 10.0.100.1 eth1
Router3 IP = 10.0.100.3 GW = 10.0.100.1 eth1

Each of the routers has a different subnet used for servers and hosts, so the 10.0.100.0 range are used for the routers
I've tried so many different things, but nothing seems to work, so I don't know what I'm missing.
 
User avatar
xvo
Forum Guru
Forum Guru
Posts: 1237
Joined: Sat Mar 03, 2018 1:12 am
Location: Moscow, Russia

Re: Failover between three Mikrotik routers

Fri Sep 27, 2019 1:27 pm

You don’t need to change any existing addresses, routes. Just add additional routes (IP -> Routes).
 
nemo42za
just joined
Topic Author
Posts: 6
Joined: Wed Nov 21, 2018 1:28 pm

Re: Failover between three Mikrotik routers

Fri Sep 27, 2019 1:38 pm

You don’t need to change any existing addresses, routes. Just add additional routes (IP -> Routes).
So you're saying, Router2 would be: dist = 10.0.100.2 GW = 10.0.100.3 and then Router3 would be the other way around, I.E dist = 10.0.100.3 GW = 10.0.100.2?
 
marting
Member Candidate
Member Candidate
Posts: 172
Joined: Thu Aug 21, 2014 2:07 pm

Re: Failover between three Mikrotik routers

Fri Sep 27, 2019 1:41 pm

On router 2 it could look like this:
/ip route
add distance=10 dst-address=0.0.0.0/0 gateway=10.0.100.1
add distance=20 dst-address=0.0.0.0/0 gateway=10.0.100.3

On router 3 it could look like this:
/ip route
add distance=10 dst-address=0.0.0.0/0 gateway=10.0.100.1
add distance=20 dst-address=0.0.0.0/0 gateway=10.0.100.2
 
User avatar
xvo
Forum Guru
Forum Guru
Posts: 1237
Joined: Sat Mar 03, 2018 1:12 am
Location: Moscow, Russia

Re: Failover between three Mikrotik routers

Fri Sep 27, 2019 1:43 pm

Wait. If r1-r2 and r1–r3 are bridged together, then just bridge r2-r3 link with them and run stp on the briges. That would be the easiest way.
 
faisali
Member Candidate
Member Candidate
Posts: 180
Joined: Fri Oct 08, 2010 5:11 am

Re: Failover between three Mikrotik routers

Thu Oct 03, 2019 4:57 am

You can do this with static routes and distance settings, i.e. installing static routes on all three pointing to each other and using gateway check to remove them from being active...

or you can do this via dynamic protocol.. i.e. setup OSPF on all three routers < ---- That would be the preferred way :)
 
User avatar
ingdaka
Trainer
Trainer
Posts: 452
Joined: Thu Aug 30, 2012 3:06 pm
Location: Albania
Contact:

Re: Failover between three Mikrotik routers

Thu Oct 03, 2019 9:19 pm

If you have just 1 or 2 subnets in each router you can use static routing, but if you have mode I would prefer OSPF

Who is online

Users browsing this forum: No registered users and 18 guests