Community discussions

 
yassermzh
just joined
Topic Author
Posts: 12
Joined: Thu Dec 29, 2011 3:16 pm

How to check the SECOND next hop to see if a route is up?

Sat Mar 17, 2012 8:36 am

Is there any way to check the second "next hop" as a check to see if a route is up. Mikrotik has only "check gateway" option when defining a route, so it only checks the first next hop.

The company I work in has connection to two ISPs, ISP1 and ISP2. I want to use ISP1 by default, and to use ISP2 when ISP1 has problem. The modem connecting me to ISP1 is in route mode. so the "next hop" from Mikrotik, i.e. the modem, is always up regardless of ISP1 is up or down. So Mikrotik checking the "next hop" (the modem) can't choose ISP2 when ISP1 is down...

Thanks,
Yasser
 
yassermzh
just joined
Topic Author
Posts: 12
Joined: Thu Dec 29, 2011 3:16 pm

Re: How to check the SECOND next hop to see if a route is up

Sun Mar 18, 2012 12:42 pm

Nobody? :|

It seems that this topic is called "Static Route Tracking using IP SLA" in cisco context; "Object tracking" and ... sample configuration in Cisco:
R1(config)# ip sla 1
R1(config)# icmp-echo 2.2.2.2 source-interface FastEthernet0/0
R1(config)# timeout 1000
R1(config)# threshold 2
R1(config)# frequency 3
R1(config)# ip sla schedule 1 life forever start-time now

R1(config)# ip route 0.0.0.0 0.0.0.0 2.2.2.2 track 1
R1(config)# ip route 0.0.0.0 0.0.0.0 3.3.3.3 10
Is there something similar in Mikrotik?
 
User avatar
cbrown
Trainer
Trainer
Posts: 1840
Joined: Thu Oct 14, 2010 8:57 pm
Contact:

How to check the SECOND next hop to see if a route is up?

Sun Mar 18, 2012 9:10 pm

C.Brown

cbrown[at]ravenrocknetworks.com
MTCNA - MTCRE - MTCWE - MTCTCE
MTCSE - TRAINER-0179
 
User avatar
NAB
Trainer
Trainer
Posts: 503
Joined: Tue Feb 10, 2009 4:08 pm
Location: UK
Contact:

Re: How to check the SECOND next hop to see if a route is up

Mon Mar 19, 2012 1:42 pm

Is there something similar in Mikrotik?
Yes... It takes a bit of thinking to get your head around though.
Essentially, you create a route to the target gateway that's two hops away and set the gateway for that route to be the device one hop away. You also set the scope for that route to be '10'.
Then you create a default route and make the gateway for that route the device two hops away. You also put check-gateway as 'ping'.
From my setup:
/ip route
add dst-address=192.168.1.254/32 gateway=10.2.2.248 scope=10
add dst-address=0.0.0.0/0 gateway=192.168.1.254 check-gateway=ping
192.168.1.254 is the gateway two hops away and 10.2.2.248 is the gateway one hop away.
Hope that makes sense!
Nicholas Barnes BSc(hons)
Certified Mikrotik Consultant
Certified Mikrotik Trainer

Vitell - Asterisk, Linux and network consultants
Unofficial IRC channel: #routerboard on irc.z.je
 
yassermzh
just joined
Topic Author
Posts: 12
Joined: Thu Dec 29, 2011 3:16 pm

Re: How to check the SECOND next hop to see if a route is up

Mon Mar 19, 2012 3:30 pm

Thanks Nick... I don't understand "scope" and "target scope" concept yet, but I checked your solution and it works fine.
Thanks cbrown... I checked your solution and it works too.
Thanks again.
 
kazim
newbie
Posts: 27
Joined: Tue Feb 14, 2012 3:39 pm

Re: How to check the SECOND next hop to see if a route is up

Tue Feb 25, 2014 3:13 pm

hello,
ip route
add dst-address=192.168.1.254/32 gateway=10.2.2.248 scope=10
add dst-address=0.0.0.0/0 gateway=192.168.1.254 check-gateway=ping

need some more information regarding the thee above setup.

1) when the primary link down for how many timeout link will shift to secondary link.
2) and when the primary link up in ow many seconds it will shift to the primary link.

any body knows
 
SurferTim
Forum Guru
Forum Guru
Posts: 4637
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: How to check the SECOND next hop to see if a route is up

Tue Feb 25, 2014 3:48 pm

You could use a script to ping the second hop ip. Schedule it to run at whatever time period you desire.
 
jarda
Forum Guru
Forum Guru
Posts: 7604
Joined: Mon Oct 22, 2012 4:46 pm

Re: How to check the SECOND next hop to see if a route is up

Tue Feb 25, 2014 4:10 pm

Why to check second next hop? Check any reliable ip address of internet and if unaccessible, switch the route. I have done it so. Remember, you need static route to checking address in order to be able to check it even all other traffic goes via isp2.

Sent from Android by Tapatalk.

Who is online

Users browsing this forum: MSN [Bot] and 115 guests