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

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Static Route vs. Dynamic Routing

Please see attachments.

On sa26-man-r1, when I configure "ip route 10.4.8.0 255.255.255.0 10.0.0.1", it does not go over the correct link?

I would assume that static routes takes precedence over dynamuic routing.

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Hall of Fame Super Silver

Re: Static Route vs. Dynamic Routing

David

I think that I understand what is going on with your situation. Your static route is creating a prefix in your routing table with a length of /24. The other router running OSPF is advertising the loopback interfaces. And if you check your routing table you should find that OSPF is advertising the loopback addresses as /32. (advertising loopback interfaces as /32 is a behavior of IOS that may not be widely known) So if you do a show ip route on the sa26 router I believe that you will see both your /24 static route and a pair of /32 routes. And since routing decisions use the longest prefix you are routing using the /32 OSPF routes and not the /24 static.

The question of administrative distance in which a static route is preferred over a dynamic route only works on prefixes of the same length. Since the prefixes in your case are different lengths the issue of static over dynamic does not come into play.

Note that if you configure the other router loopback interfaces with the command ospf network point-to-point, then the router will advertise them as /24 and your static route should be chosen.

HTH

Rick

3 REPLIES
Hall of Fame Super Silver

Re: Static Route vs. Dynamic Routing

David

I think that I understand what is going on with your situation. Your static route is creating a prefix in your routing table with a length of /24. The other router running OSPF is advertising the loopback interfaces. And if you check your routing table you should find that OSPF is advertising the loopback addresses as /32. (advertising loopback interfaces as /32 is a behavior of IOS that may not be widely known) So if you do a show ip route on the sa26 router I believe that you will see both your /24 static route and a pair of /32 routes. And since routing decisions use the longest prefix you are routing using the /32 OSPF routes and not the /24 static.

The question of administrative distance in which a static route is preferred over a dynamic route only works on prefixes of the same length. Since the prefixes in your case are different lengths the issue of static over dynamic does not come into play.

Note that if you configure the other router loopback interfaces with the command ospf network point-to-point, then the router will advertise them as /24 and your static route should be chosen.

HTH

Rick

New Member

Re: Static Route vs. Dynamic Routing

thanks Rick. You're a genius.

Hall of Fame Super Silver

Re: Static Route vs. Dynamic Routing

David

I am glad that my response helped to resolve your question. Thank you for using the rating system to indicate that your question was resolved (and thanks for the rating). It makes the forum more useful when people can read about a question and can know that they will find response that did resolve the question.

The forum is an excellent place to learn about Cisco networking. I encourage you to continue your praticipation in the forum.

HTH

Rick

1288
Views
0
Helpful
3
Replies
CreatePlease login to create content