Static Route vs. Dynamic Routing

Answered Question
Sep 11th, 2009

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.

I have this problem too.
0 votes
Correct Answer by Richard Burts about 7 years 3 months ago

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

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Correct Answer
Richard Burts Fri, 09/11/2009 - 08:00

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

Richard Burts Fri, 09/11/2009 - 08:30

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

Actions

This Discussion