cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
354
Views
10
Helpful
3
Replies

static route and ospf

Danilo Dy
VIP Alumni
VIP Alumni

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

Harold Ritter
Cisco Employee
Cisco Employee

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

View solution in original post

3 Replies 3

tdrais
Level 7
Level 7

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.

Harold Ritter
Cisco Employee
Cisco Employee

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

Cool....that works :)

Thanks Harold

Regards,

Dandy

Getting Started

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:

Review Cisco Networking products for a $25 gift card