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?
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.