cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
603
Views
3
Helpful
5
Replies

secondry static route issue

jspsumit888
Level 1
Level 1

I have default route

ip route 172.16.1.0 255.255.255.0 192.168.10.4

IP route 172.16.1.0 255.255.255.0 192.168.10.5 2

when 192.168.10.4 is down. why has traffic not shifted to 192.168.10.5?

 

5 Replies 5

Add egress interface to static route to make router detect down of next hop.

 

Thanks A Lot
MHM

Torbjørn
VIP
VIP

Hi @jspsumit888,

You can add the interface name to your static route if the next-hop IP(192.168.10.4) is connected to a point-to-point link. This will cause the primary default route to be withdrawn from the IP table if the interface transitions to DOWN state.

Alternatively you can configure BFD to check that the gateway IP is accessible. This is a good method to achieve this if your gateway is on a shared segment or you need a more reliable check than interface status. This can be configured as follows:

! Configure BFD on the gateway interface on the gateway device
interface { interface name }
bfd interval 500 min_rx 500 multiplier 5
exit

! Configure BFD for your egress interface on the device with the bfd static routes.
interface { interface name }
bfd interval 500 min_rx 500 multiplier 5
exit

! Set up BFD tracking group for next-hop address
ip route static bfd {egress interface} 192.168.10.4 group group1

! Configure your static routes, where the primary is tracked by your BFD group
ip route bfd 172.16.1.0 255.255.255.0 { egress interface } 192.168.10.4 group group1
ip route 172.16.1.0 255.255.255.0 192.168.10.5 2

You can read more about this in this configuration guide: https://www.cisco.com/c/en/us/td/docs/routers/ios/config/17-x/ip-routing/b-ip-routing/m_irb-bi-fwd-det-0-1.html 

Happy to help! Please mark as helpful/solution if applicable.
Get in touch: https://torbjorn.dev

DanielP211
VIP Alumni
VIP Alumni

Hello!

I would use IP SLA tracking.

ip sla 1
icmp-echo 192.168.10.4 source-interface gigX/X
timeout 1000
threshold 2000
frequency 15


ip sla schedule 1 start now life forever
track 10 rtr1 reachabilty 


ip route 172.16.1.0 255.255.255.0 192.168.10.4 track10  

IP route 172.16.1.0 255.255.255.0 192.168.10.5 2


BR

****Kindly rate all useful posts*****

Joseph W. Doherty
Hall of Fame
Hall of Fame

"when 192.168.10.4 is down. why has traffic not shifted to 192.168.10.5?"

Most likely because router doesn't know it can no longer reach that IP and has not withdrawn the lower cost static route.  If that's the case, the other posters have provided various methods to let the router know to withdraw the lower cost static route.

BTW, another approach might be to use a dynamic routing protocol.

Richard Burts
Hall of Fame
Hall of Fame

The original post says "when 192.168.10.4 is down". We need to be very careful about the meaning of down. I suspect that the original poster really means that the neighbor at that address is no longer reachable. And that is not necessarily the same as down. Cisco is quite specific about down and that means that the interface used to reach the address is in the down state.

Given that both static routes have next hop addresses that are sequential we can be sure that this is not a point to point interface and pretty confident that it is some type of Ethernet interface. It is a fairly common issue with static routes and Ethernet interfaces. Adding the interface to the static route is probably a good idea, but unfortunately will not solve the issue of neighbor not reachable but interface not in down state. Track is the usual solution for this. BFD is an interesting idea.

HTH

Rick