Influencing OSPF Routes

Answered Question
Sep 19th, 2008

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

I have this problem too.
0 votes
Correct Answer by sdoremus33 about 8 years 2 months ago

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

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (3 ratings)
Loading.
Correct Answer
sdoremus33 Fri, 09/19/2008 - 07:48

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 Fri, 09/19/2008 - 07:48

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.

Joseph W. Doherty Fri, 09/19/2008 - 09:22

"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?

alraycisco Fri, 09/19/2008 - 12:42

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

Joseph W. Doherty Fri, 09/19/2008 - 15:44

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.

Actions

This Discussion