cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
875
Views
10
Helpful
6
Replies

Influencing OSPF Routes

alraycisco
Level 1
Level 1

Hi,

I have 3 routers in a hub and spoke setup. The 2 spokes both have an inside interface on the same subnet (192.168.1.x). I have enabled OSPF on the routers and the routes are being exchanged. The hub router has learned the 2 routes for the 192.168.1.x subnet. I'm assuming on the Hub router by default OSPF will perform equal cost load sharing over the 2 routers for the 192.168.1.x subnet.

My question is what is the best way to get OSPF to only use one of the links for this subnet (of my choice) and to only use the second link if the first fails? Would I change the bandwidth settings on the hub router interfaces or is there another way to do this?

Thanks in advance

1 Accepted Solution

Accepted Solutions

sdoremus33
Level 3
Level 3

One thing you could do is to change the ip ospf cost under the specific interface tou want to be preffered. Remember the lower the cost the better Ex:

If you are Load sharing across multiple links lets say ser1/0 and seri1/1, to make seri1/0 the preferred link do the following

config t

interface serial1/0

ip address x.x.x.x y.y.y.y

ip ospf cost 1

Interface serial1/1

ip address x.x.x.x y.y.y.y

ip ospf cost 2

Then the serial1/0 interface will be choosen based on the lower cost value in the ip ospf cost command. HTH

View solution in original post

6 Replies 6

sdoremus33
Level 3
Level 3

One thing you could do is to change the ip ospf cost under the specific interface tou want to be preffered. Remember the lower the cost the better Ex:

If you are Load sharing across multiple links lets say ser1/0 and seri1/1, to make seri1/0 the preferred link do the following

config t

interface serial1/0

ip address x.x.x.x y.y.y.y

ip ospf cost 1

Interface serial1/1

ip address x.x.x.x y.y.y.y

ip ospf cost 2

Then the serial1/0 interface will be choosen based on the lower cost value in the ip ospf cost command. HTH

rais
Level 7
Level 7

You should be able to alter the cost of route you want not to be taken primarily. Increasing it's cost to more than the other one would get you desired results.

Thanks.

Thanks guys

Joseph W. Doherty
Hall of Fame
Hall of Fame

"Would I change the bandwidth settings on the hub router interfaces . . ."

You could if auto costing was active.

". . . or is there another way to do this?"

Answered in other posts, but you sometimes need to be cautious what values you use for explict costing. For instance, setting cost to 1 indicates the best absolute link cost, but since end-to-end cost are cumulative, you want to avoid situation where part of your LAN decides the best path is via a branch. You also have to watch for wrapping the OSPF cost.

Also, if you looked to see if the link was already auto costed, and the assigned cost value (sh ip os in), you would only need to change one of the two interfaces to be better or worse than the other.

PS:

Besides the above, what prompted me to write was being curious about your question. Usually the question, for your described topology, is the converse, i.e. how do you use both links from the branch to the hub. Is there a reason why you want primary/secondary rather than use both links?

Hi, thanks for the reply.

There will be site-to-site VPN tunnels between the routers, SiteA will have 2 tunnels to SiteB, but ultimately the tunnel destinations are the same subnet. So in this scenrio load balancing isn't really an option. Also, one of the links is considerably faster than the other.

Thanks

If you run OSPF across the tunnels, and the underlying bandwidth is different, just configure the bandwidth statement (for the tunnel) to reflect the underlying bandwidth. If OSPF auto costing is active, the traffic will chose the better path.

(If the two paths were close to the same bandwidth, which you say they're not, it's sometimes good to insure they're seen as two equal cost paths.)

PS:

If you platforms support it, suggest running tunnel keep alives across the tunnel.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card