11-07-2023 01:52 AM
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?
11-07-2023 01:58 AM
Add egress interface to static route to make router detect down of next hop.
Thanks A Lot
MHM
11-07-2023 03:21 AM - edited 11-07-2023 06:05 AM
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
11-07-2023 03:51 AM
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
11-07-2023 05:11 AM
"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.
11-07-2023 12:06 PM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide