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

Posted on 2009-02-17
Last Modified: 2013-11-12
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
Question by:AshlandSG
    LVL 50

    Accepted Solution

    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>

    Author Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    Understanding FTPS File transfer is a common requirement in most Enterprises. While there are numerous ways to get a file from Point A to Point B over a network, perhaps the most common method still in use is FTP – File Transfer Protocol. FTP is …
    SSL is a very common protocol used these days when browsing the web.  The purpose is to provide security to communication, but how does it do it?  There are several pieces at work that have to be setup before SSL will even work and it requires both …
    Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…
    After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now