1

Config:

ip route 172.27.8.17/32 172.24.0.141
ip route 172.27.8.17/32 172.24.0.102 2

Result:

show ip route 172.27.8.17
Routing entry for 172.27.8.17/32
  Known via "static", distance 2, metric 0
    172.24.0.102, via me0_link1

Routing entry for 172.27.8.17/32
  Known via "static", distance 1, metric 0, best
  * 172.24.0.141, via me0_link2

as you see I set link2 as higher preference on static route, but when link2 failed, does router smart enough to adjust route to link1?

  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 7 '17 at 18:46
1

Yes. If an interface goes down, then any route in the routing table pointing to that interface is withdrawn from the routing table. The route will be reestablished in the routing table when the interface comes back up.

The situation you describe is called a floating static route. This is a useful configuration for some circumstances.

  • How can we achieve this : when me0_link1 is down, traffic should go via me0_link2 ? Does it work in mtik router ? – Shyamkkhadka Oct 26 '18 at 5:57
  • 1
    I don't know enough about MikroTik, but, unfortunately, MikroTik doesn't offer optional paid support, so it is off-topic here. – Ron Maupin Oct 26 '18 at 5:59
  • What about cisco routers ? Does it work or we need to configure additional steps ? – Shyamkkhadka Oct 26 '18 at 6:02
  • 1
    Yes, it works for Cisco routers. Simply put in two static routes for the same route, and add a different AD, like it has in the question. – Ron Maupin Oct 26 '18 at 6:04
0

Assuming Cisco, the answer is no. It will keep sending to 172.24.0.141. You will need to configure tracking with an ip sla to failover properly.

  • how does ip sla works? mind to explain in detail please? – Thomas G. Lau Jun 23 '17 at 8:26
  • 1. Create ip sla object with icmp-echo 2. Create track object and associate ip sla to the track object 3. Add track command to end of static route, which will decrement the administrative distance when the ip sla is down. If you wan to just monitor if the interface goes down you can also track the line protocol of an interface; this is configured within the track object. Cisco has published a lot of great documents for the configuration details. – esafresa Jun 23 '17 at 17:46
  • Just tracking line protocol might work better for you, which would look something like: track 1 interface me0_link2 line-protocol – esafresa Jun 23 '17 at 17:52
0

If the next-hop for link2 (172.24.0.141) goes down (is no longer in the routing table), then the route will no longer be valid and will also be removed. Link1 will now be the only valid route and become the best route to 172.27.8.17.

If the next-hop (172.24.0.141) is still available after the failure, the route will not be lost and will still be best. With some vendors, you can also specify an outgoing interface in addition to a next hop within a static route. If the outgoing interface is lost, the route will be removed, even if the next-hop is still active. Format would be similar to the following

ip route 172.27.8.17/32 172.24.0.141 me0_link2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.