• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2666
  • Last Modified:

How do I force OSPF to prefer a certain route when there are active redundant, meshed routes?

I tried to connect multiple sites with redundant, meshed routes and OSPF was preferring some routes over others in what seems to be an uncontrolled fashion.  I would like to give routing preferences and only use alternative route when a circuit goes down.

For example, A-B connects over a 54Mbps wireless.  A-C connects over a 1.5Mbps MPLS.  B-C connects over a 1.5Mbps T1 via GRE/IPsec tunnel.  For some reason, OSPF tells C that the best route is to B, two hops away, not A, one hop away.

I tried to set Priority 1 on A-C at C and Priority 100 on B-C at same.  Doesn't seem to change OSPF preference.  Perhaps I'm using the wrong keyword.  Cisco 1841 routers.

Please note that this is more complicated than the above.  I have A/B, A/C, A/D, A/E, etc. and there are B/C, B/D, B/E, etc. in case A fails.  Furthermore, there are two routers at A and B, one connecting A/B only (PTP wireless) and one connecting to the Internet/MPLS with tunnels to each location, including between A/B (in case the PTP fails).

The simpliest term is that each location (C, D, etc.) have connections to A.  Some locations have two connections, a MPLS and an IPsec VPN through Internet.  All location also have an IPsec VPN through Internet to B, too.  So, that's a total of 2 (no MPLS) or 3 (with MPLS) connections per location.  I need OSPF at other locations to prefer MPLS (if applicable), IPsec to A and finally IPsec to B in that order.  No load balancing, just auto-update OSPF only when circuits/routers go down.

As for A/B, they should prefer the 54Mbps PTP route then the IPsec VPN route between themselves.


John Babbitt
Systems Administrator
Ashland Support Group
1 Solution
Don JohnstonInstructorCommented:
The first method of controlling the path selection in OSPF is by adjusting the cost of the links.

The priority has nothing to do with how OSPF selects the path. Priority is used to determine the designated router on a multiaccess network.

The second method of controlling path selection would be to change the administrative distance for selected networks.

But try changing the link cost first.

To change the link cost, in interface config mode, use the command:

ip ospf cost <1 - 65535>
AshlandSGAuthor Commented:
You're not forgotten but this has been put on the back burner until after March 16th.  Big project going on.  However, I will certainly give your solution a try and if it works, assign you the points.

Looking at my configs not too long ago, I do see ip ospf cost though it doesn't seem to work.  However, I learned that I also need to apply that to all the individual interfaces.  I'll have to sort it all out and give it a try.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

We Need Your Input!

WatchGuard is currently running a beta program for our new macOS Host Sensor for our Threat Detection and Response service. We're looking for more macOS users to help provide insight and feedback to help us make the product even better. Please sign up for our beta program today!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now