route preference - ospf or static.

As I understand it, connected routes have 1 weight and OSPF routes have

110 weight. Now what happens in a case where I have a /24 ospf route (e2) being learned on a device and I put a static route that is /23 (which should cover that /24 route that I learn via ospf) what takes over then?

I have this setup but can't really screw with production environment to try this or I'd do that before posting.


Reply to
Loading thread data ...

Longest mask length ALWAYS wins.

Reply to
John Agosta

Who needs Cisco documentation? That rule is one of the fundamental rules of IP routing. Look it up in any book on routing.

Reply to

Absolutely correct. But, just in case the OP is still looking...

formatting link
BTW - that took all of about 2 minutes to search Cisco's site and read the key points of the article.

Reply to

google administrative distance route selection

Reply to
John Agosta

It's not just that, it's that we're comparing two different things. The administrative distance (the weight the OP refers to) is used to decide which routing protocol to take a routing table entry from - if the same prefix (same value, same prefix length) is learned in two different protocols the better admin distance is chosen. Once routes are installed in the table then longest match decides which entry is used to route the packet. Prefixes of two different lengths don't conflict when it comes to admin distance.


Reply to
Sam Wilson

I agree with Sam. During the Route selection process, longest prefix matched is prefered. If the prefix length is same then admin distance is compared.


Manohar wrote:

Reply to
Manohar Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.