Community discussions

MikroTik App
 
mikrotikbeliever88
just joined
Topic Author
Posts: 7
Joined: Sat Jun 16, 2018 4:03 am

3 recursive route failover

Mon Oct 29, 2018 4:42 am

How to set 3 recursive route failover in the ccr-1009.
I know how to set 2 recursive route failover in ccr using this:
/ip route
add dst-address= 8.8.8.8/32 gateway = 10.0.1.1 scope = 10 comment="Validate Primary"
add gateway=8.8.8.8 distance = 1 check-gateway = ping comment="Primary Route"
add gateway=10.0.2.1 distance = 2 comment = "Secondary Route"

Thanks in advanced
 
ayub123
just joined
Posts: 1
Joined: Mon Oct 22, 2018 11:26 am

Re: 3 recursive route failover

Fri Apr 05, 2019 11:07 pm

3 recrusive route failover
Example: we have 3 address list 192.168.1.1,192.168.2.1 and 192.168.3.1 ( Please configure your ip address as your network configure)
select any 3 open dns like google , open dns or any public dns
Example of dns selection
network 192.168.1.1 chosen dns 8.8.8.8
network 192.168.2.1 chosen dns 8.8.4.4
network 192.168.3.1 chosen dns 1.1.1.1

/ip route
add dst-address= 8.8.8.8 gateway = 192.168.1.1 scope = 10
add gateway=8.8.8.8 distance = 1 check-gateway = ping comment="Primary Route"
add dst-address= 8.8.4.4 gateway = 192.168.2.1 scope = 10
add gateway=8.8.4.4 distance = 2 check-gateway = ping comment="Secondry Route"
add dst-address= 1.1.1.1 gateway = 192.168.3.1 scope = 10
add gateway=1.1.1.1 distance = 3 check-gateway = ping comment="Thrid Route"

This configration will do auto failover even your isp interface up but not responding it will change over to second route and as to third route.

Please check and let me know.
 
angboontiong
Forum Guru
Forum Guru
Posts: 1136
Joined: Fri Jan 16, 2009 9:59 am

Re: 3 recursive route failover

Tue May 14, 2019 7:41 pm

3 recrusive route failover
Example: we have 3 address list 192.168.1.1,192.168.2.1 and 192.168.3.1 ( Please configure your ip address as your network configure)
select any 3 open dns like google , open dns or any public dns
Example of dns selection
network 192.168.1.1 chosen dns 8.8.8.8
network 192.168.2.1 chosen dns 8.8.4.4
network 192.168.3.1 chosen dns 1.1.1.1

/ip route
add dst-address= 8.8.8.8 gateway = 192.168.1.1 scope = 10
add gateway=8.8.8.8 distance = 1 check-gateway = ping comment="Primary Route"
add dst-address= 8.8.4.4 gateway = 192.168.2.1 scope = 10
add gateway=8.8.4.4 distance = 2 check-gateway = ping comment="Secondry Route"
add dst-address= 1.1.1.1 gateway = 192.168.3.1 scope = 10
add gateway=1.1.1.1 distance = 3 check-gateway = ping comment="Thrid Route"

This configration will do auto failover even your isp interface up but not responding it will change over to second route and as to third route.

Please check and let me know.
Hi,
Do it need add virtual host?
 
sindy
Forum Guru
Forum Guru
Posts: 10206
Joined: Mon Dec 04, 2017 9:19 pm

Re: 3 recursive route failover

Tue May 14, 2019 9:54 pm

Do it need add virtual host?
What do you mean by virtual host? The failover between 3 WANs done this way is just an extension of the one you use for 2 WANs, nothing changed on the principle, still only one WAN is used at a time (and yes, the lowest priority one need not the availability checking via recursive next-hop search if you don't distribute the traffic among them but really strictly choose one in the order of priority for all traffic).
 
angboontiong
Forum Guru
Forum Guru
Posts: 1136
Joined: Fri Jan 16, 2009 9:59 am

Re: 3 recursive route failover

Wed May 15, 2019 2:34 pm

Do it need add virtual host?
What do you mean by virtual host? The failover between 3 WANs done this way is just an extension of the one you use for 2 WANs, nothing changed on the principle, still only one WAN is used at a time (and yes, the lowest priority one need not the availability checking via recursive next-hop search if you don't distribute the traffic among them but really strictly choose one in the order of priority for all traffic).
i mean this

https://wiki.mikrotik.com/wiki/Advanced ... _Scripting
 
sindy
Forum Guru
Forum Guru
Posts: 10206
Joined: Mon Dec 04, 2017 9:19 pm

Re: 3 recursive route failover

Wed May 15, 2019 2:48 pm

OK, so you mean a virtual hop, not a virtual host.

You do not need a virtual hop to fail over among several WANs. The purpose of using a virtual hop is to allow monitoring of availability of a given link using several hosts in the internet, so if at least one of those hosts responds to pings, the link is considered working. Without it, a fault of the single monitored host causes the link to be considered unavailable.

So this has nothing to do with the number of WAN links and with the way you use them (exclusively by priority or distributing the load among them or a mixture of these).
 
angboontiong
Forum Guru
Forum Guru
Posts: 1136
Joined: Fri Jan 16, 2009 9:59 am

Re: 3 recursive route failover

Wed May 15, 2019 3:19 pm

OK, so you mean a virtual hop, not a virtual host.

You do not need a virtual hop to fail over among several WANs. The purpose of using a virtual hop is to allow monitoring of availability of a given link using several hosts in the internet, so if at least one of those hosts responds to pings, the link is considered working. Without it, a fault of the single monitored host causes the link to be considered unavailable.

So this has nothing to do with the number of WAN links and with the way you use them (exclusively by priority or distributing the load among them or a mixture of these).
Hi,
thanks for sharing, if i am using 4 WAN load balance from:
https://aacable.wordpress.com/tag/mikro ... d-balance/


so i just need this to check on my 4 WAN right? please correct me if i am wrong.
/ip route
add dst-address= 8.8.8.8 gateway = 192.168.1.1 scope = 10
add gateway=8.8.8.8 distance = 1 check-gateway = ping comment="Primary Route"
add dst-address= 8.8.4.4 gateway = 192.168.2.1 scope = 10
add gateway=8.8.4.4 distance = 2 check-gateway = ping comment="Secondry Route"
add dst-address= 1.1.1.1 gateway = 192.168.3.1 scope = 10
add gateway=1.1.1.1 distance = 3 check-gateway = ping comment="Thrid Route"
add dst-address= 1.1.1.1 gateway = 192.168.4.1 scope = 10
add gateway=1.1.1.1 distance = 4 check-gateway = ping comment="Fourth Route"
 
sindy
Forum Guru
Forum Guru
Posts: 10206
Joined: Mon Dec 04, 2017 9:19 pm

Re: 3 recursive route failover

Wed May 15, 2019 3:54 pm

if i am using 4 WAN load balance from:
https://aacable.wordpress.com/tag/mikro ... d-balance/

so i just need this to check on my 4 WAN right? please correct me if i am wrong.
I assume it is a copy-paste error that your monitored address for both WAN3 and WAN4 is 1.1.1.1 and that they are actually different. If so (copy-paste error), then yes, these 4×2 routes are sufficient for having all 4 WANs monitored for actual access to internet.

But to distribute (balance) the load among the WANs, you need to use marked routes and assign routing-marks: out of the 4 routes above with 0dst-address=0.0.0.0/0 and no routing-mark, only one is used at a time - in particular, the one with highest priority (lowest value of distance) out of those which are available.
 
dricks
just joined
Posts: 14
Joined: Fri Jan 08, 2010 7:31 pm
Location: Embarcacion

Re: 3 recursive route failover

Sun Mar 21, 2021 8:11 am

ty for post work perfect, save my day!
 
gotsprings
Forum Guru
Forum Guru
Posts: 2103
Joined: Mon May 14, 2012 9:30 pm

Re: 3 recursive route failover

Sun Mar 21, 2021 10:17 am

When and how do you flush your connections?

I am using netwatch on my primary.
If that netwatch goes up or down I flush the firewall connections.

Think ing I should use something with more than one ping or maybe two stages.

But what works for you guys?
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19125
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: 3 recursive route failover

Sun Mar 21, 2021 1:03 pm

Hi Gotsprings, the answer is I dont flush. ;-)

Seriously, if my main connection goes down for whatever reason it may be very temporary and by flushing things I wiipe out any connections.
If only temporary everything continues kinda okay, but if one has flushed connections then all is lost.
WHat you are doing only seems to apply if a connection is hard down and not good for intermittent interruption.
This is just a theory but one of the reasons besides laziness that I dont add netwatch etc.to the equation.

PS just for giggles last night I added netwatch for the WAN and then primary devices on my network, switches, aps etc. just to see if they work (emails me).
 
gotsprings
Forum Guru
Forum Guru
Posts: 2103
Joined: Mon May 14, 2012 9:30 pm

Re: 3 recursive route failover

Sun Mar 21, 2021 2:01 pm

I have mangle and a static route set up for my backup connection. This allows me to track and connect over the backup even if the primary is up.

Problem sometimes arises when the system is running on the secondary.... Then the primary comes back.

Since that route is set there... Things are not forced off the secondary. So you have to wait for connections to time out. Which could be hours.

Ergo... Flush to kick everything and make it move back to the primary.

This was mostly based on when I had a very slow metered connection for a backup. So you only wanna use it when you have to. Because once you hit the monthly limit for data... It slows down to 200K.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19125
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: 3 recursive route failover

Sun Mar 21, 2021 2:15 pm

No caps here,
So what I would considering doing is flushing the cache after 60 seconds of a switch. ISP1 to ISP2
In other words, detect switch, check after 60 seconds if still switched then flush? if still connected via ISP2 flush

and vice versa.
or something like that.

Trying to avoid interrupting connections by users for an intermittent issue or a glitch and then flushing prematurely.
What would be a safe but effective time frame to do the above or is there a better way??
 
gotsprings
Forum Guru
Forum Guru
Posts: 2103
Joined: Mon May 14, 2012 9:30 pm

Re: 3 recursive route failover

Sun Mar 21, 2021 2:32 pm

Simple 3/5 ping test would probably be good enough.

But I was thinking about stacking netwatches..
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19125
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: 3 recursive route failover

Sun Mar 21, 2021 4:13 pm

Simple 3/5 ping test would probably be good enough.

But I was thinking about stacking netwatches..
Why not do an IF statement in a single netwatch script.
IF 3 successive pings at 5 seconds apart = no connectiivity to ISP1 then
a. check router is now using ISP2
b. flush DNS
 
gotsprings
Forum Guru
Forum Guru
Posts: 2103
Joined: Mon May 14, 2012 9:30 pm

Re: 3 recursive route failover

Sun Mar 21, 2021 4:44 pm

Simple 3/5 ping test would probably be good enough.

But I was thinking about stacking netwatches..
Why not do an IF statement in a single netwatch script.
IF 3 successive pings at 5 seconds apart = no connectiivity to ISP1 then
a. check router is now using ISP2
b. flush DNS
Pretty close to what I meant.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19125
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: 3 recursive route failover

Sun Mar 21, 2021 5:33 pm

Kewl, would be interested in seeing such a script if you develop one. Right now trying to add telegram messages to iphone from router........ sunday fun.
 
gotsprings
Forum Guru
Forum Guru
Posts: 2103
Joined: Mon May 14, 2012 9:30 pm

Re: 3 recursive route failover

Sun Mar 21, 2021 7:52 pm

Kewl, would be interested in seeing such a script if you develop one. Right now trying to add telegram messages to iphone from router........ sunday fun.
Domotz handles most of my remote monitoring.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19125
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: 3 recursive route failover

Mon Mar 22, 2021 1:58 am

Why would I buy a cloud service when my router does it for free?
Why would I put all my devices status on the cloud for all to see, if its on the cloud ultimately its not secure.
 
gotsprings
Forum Guru
Forum Guru
Posts: 2103
Joined: Mon May 14, 2012 9:30 pm

Re: 3 recursive route failover

Mon Mar 22, 2021 9:53 am

Why would I buy a cloud service when my router does it for free?
Why would I put all my devices status on the cloud for all to see, if its on the cloud ultimately its not secure.
Your router does not report when it's offline. And there are a host of other things that Domotz can keep track of and alert on that makes it very worth while.

Domotz privacy policy is pretty extensive.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19125
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: 3 recursive route failover

Mon Mar 22, 2021 3:37 pm

I have better indications that the cloud if the main router is not working.
I get yelled at from many different directions (meaning, tympanic membrane medium for communications - very direct)

Who is online

Users browsing this forum: No registered users and 36 guests