cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2223
Views
50
Helpful
25
Replies

OSPF and Static Routes

jgadbois
Level 1
Level 1

Is there a way to stop ospf form advertising static routes? My router is picking up my static routes and advertising them to the others.

can this be stopped?

25 Replies 25

Peter Paluch
Cisco Employee
Cisco Employee

Hello,

Do you have a command similar to redistribute static in your OSPF configuration? If so then removing it will stop your router from advertising static routes. That command is the only way how an OSPF router can be forced to advertise static routes to its neighbors. Normally, OSPF router advertises only the OSPF-discovered networks. Most certainly, static routes are not advertised in OSPF by default.

Before removing that command please make sure that by removing it, no connectivity issues will be introduced into the network.

Best regards,

Peter

Boy, that was fast. No, the command is not there but I will check all the routers. Thanks!

CriscoSystems
Level 5
Level 5

EDIT: Peter beat me to the punch!!

The router shouldn't be doing this on its own without the "redistribute static" command configured under the OSPF process. Are you sure the static routes are actually being advertised, separately, by OSPF; and not that the interfaces activated by your "network" command under OSPF are the same ones that your static routes use? (Are these static routes to remote networks, or are just the directly connected links being advertised?)

Hey Seth,

Your answer is completely flawless. Thanks for submitting it! :) Let's see what the author of the original post tells us about his config.

Best regards,

Peter

Thanks for the post. Will look at this more closely. Thanks!

Please let us know what you find out. One or more of us might learn something new.

(Peter - thanks for the thumbs-up; my BSCI studies have me hungering for encouragement!)

I'm sure it will be me. Will let you know!

Hello James,

Let me add one question: How do those static routes look like on the other routers? Are they marked as "OE1" or "OE2" in the routing table? That would be a sure sign of them being redistributed. In that case, you would be able to find out quite precisely who is advertising them.

For example, have a look here: this output contains information about an OSPF internal and external route - the 192.0.2.0/24 network marked as "OE2" is the redistributed static route:

R3#show ip route ospf

10.0.0.0/24 is subnetted, 2 subnets

O 10.0.12.0 [110/128] via 10.0.23.2, 00:00:05, Serial1/1

O E2 192.0.2.0/24 [110/20] via 10.0.23.2, 00:00:05, Serial1/1

By issuing the following command, I can find out who is actually redistributing this information:

R3#show ip route 192.0.2.0

Routing entry for 192.0.2.0/24

Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 128

Last update from 10.0.23.2 on Serial1/1, 00:01:17 ago

Routing Descriptor Blocks:

* 10.0.23.2, from 10.0.12.1, 00:01:17 ago, via Serial1/1

Route metric is 20, traffic share count is 1

Note the highlighted information: it tells me who is the ASBR advertising this route, and I know it's OSPF RouterID - it is 10.0.12.1. Now, assuming that I know which router has the RID of 10.0.12.1, I've got it.

Best regards,

Peter

Hi Seth,

Let me tell you that you should feel absolutely comfortable about your BSCI studies. The questions you are posting on these forums reveal that you are thinking very thoroughly about every topic, and by all means, that is something very valuable and very helpful in your preparations even if that is not the easiest way to go. I am sure we will soon be able to congratulate you on your passed exams - and not just BSCI :)

Keep up the good work you're doing.

Best regards,

Peter

I did find a router that has eigrp and ospf running on them. Both are redistributing routes to one another. Will eigrp pick up static routes on its own? Maybe that is how they are creeping in.

Hello James,

No routing protocol picks up and redistributes static routes by default. Each routing protocol is by default very protective of its own information and does not include information from any other routing protocol, including connected or static routes, into its database.

The EIGRP should not be therefore picking up static routes by default. It would also need to have the redistribute static command present in order to actually include them in its advertisements.

There is a notable exception for distance-vector routing protocols like EIGRP or RIP: if a static route is defined only by its output interface and not using the next-hop IP address, it is considered as directly connected. In that case, it can also be advertised in EIGRP or RIP using the network command that applies to all directly connected networks. This does not apply to link-state routing protocols like OSPF or IS-IS.

Have a look on my earlier post to find out who is redistributing the information into OSPF.

Best regards,

Peter

Peter, I can't thank you enough for the information! I will check it out and post. Thanks!

James, you kinda can thank him - by rating his post!

Please always remember to rate helpful posts.

I have been rating his posts. I forgot on the last one.

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