Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 

static route and ospf

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

1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: static route and ospf

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,

Harold Ritter
Sr. Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México
3 REPLIES
Gold

Re: static route and ospf

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.

Cisco Employee

Re: static route and ospf

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,

Harold Ritter
Sr. Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Re: static route and ospf

Cool....that works :)

Thanks Harold

Regards,

Dandy

183
Views
10
Helpful
3
Replies
CreatePlease to create content