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

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

Nobody? :neutral_face:

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?

You could try something like this.

http://wiki.mikrotik.com/wiki/Failover_via_Netwatch_III_(English)

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!

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.

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

You could use a script to ping the second hop ip. Schedule it to run at whatever time period you desire.

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.