07-18-2008 08:17 AM - edited 03-03-2019 10:48 PM
I saw someone post the same scenario before, but I can't find the post now and I can't remember if the problem was resolve.
Anyway here it is. I was playing with ospf in my little lab in the office, setup two routers with fe0/0 crossed and fe0/1 connected to switch. Configured hsrp and ospf, a static route is configured (ip route 192.168.2.0 255.255.255.0 192.168.1.1) and redistributed into ospf.
Now, if I shutdown RouterA fe0/1 (or unplug the cable) the static route will be widthrawn from the routing table and learn the route from RouterB thru ospf, but seconds later the static route will come back as preferred route.
I know that if I configure static route to fe0/1 instead of 192.168.1.1 it will fix the problem but this works for point-to-point.
How to make sure that when fe0/1 is down (line or protocol or both) the static route will be permanently widthrawn from the routing table or is there any workaround?
Thanks,
Dandy
Solved! Go to Solution.
07-18-2008 08:43 AM
Danilo,
If you want to make sure the static route is removed when the interface is down, you need configuring it using the interface as follow:
ip route 192.168.2.0 255.255.255.0 fe0/1 192.168.1.1
Otherwise, the static route will remain in the routing table as long as 192.168.1.1 is resolvable.
Regards,
07-18-2008 08:35 AM
I assume router b also has a interface on the 192.168.1.x network that is advertised into ospf.
Now when router a learns this subnet from router b (I assume you have another connection between a and b) it then assumes that the next hop is valid and put the static back in.
Unfortunately in cases like this being able to set the next hop on a static route pointing to a dynamically learn route can cause a problem.
07-18-2008 08:43 AM
Danilo,
If you want to make sure the static route is removed when the interface is down, you need configuring it using the interface as follow:
ip route 192.168.2.0 255.255.255.0 fe0/1 192.168.1.1
Otherwise, the static route will remain in the routing table as long as 192.168.1.1 is resolvable.
Regards,
07-21-2008 12:18 AM
Cool....that works :)
Thanks Harold
Regards,
Dandy
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: