Changing the cost of an OSPF route on an incoming interface

Unanswered Question
Mar 28th, 2007

Is it possible to change the OSPF path cost of a single route on an incoming interface so that it will be placed in the routing table in preference to the others. If so how's it done.

I have the same route coming in several interfaces that are equal and would like to change the cost so I have a primary route, if that fails I can have another interface that will become the preferred route. All the other interfaces can filter the route out.

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
royalblues Wed, 03/28/2007 - 02:00

Friend,

You can certainly achieve what you want. But i would sugegst changing the cost parameter of the links at both sides so that it becomes preferrable.

int fa 0/0

ip ospf cost

alternatively you can manipulate the bandwidth statement on the interface

HTH, rate if it does

Narayan

Mel Popple Wed, 03/28/2007 - 02:41

Narayan - Thanks for the response.

I looked at the 'ip ospf cost' option but that would affect all routes that are advertised over that link. I need to target just single subnets and change the cost of only that single route.

For example:

If on interfaces fa1, fa2 & fa3 on my router I saw the following routes

1.1.1.0/24 [110/2000] via fa1

via fa2

via fa3

2.2.2.0/24 [110/2000] via fa1

via fa2

via fa3

What I need to do is change the cost for 1.1.1.0/24 over fa1 to [110/1500] & the cost for 2.2.2.0 over fa2 to [110/1500] so that the route table would now be:

1.1.1.0/24 [110/1500] via fa1

2.2.2.0/24 [110/1500] via fa2

And that way if the route changes elsewhere the [110/2000] costed routes would still be there to be used.

I would of course be manipulateing the routes in a simalar way on the outside

Regards

royalblues Wed, 03/28/2007 - 04:13

Friend,

I dont think thats possible. I will try to simualte it in my lab to make sure particular route is more feasible from that interface

Narayan

answanso Wed, 03/28/2007 - 08:04

Try the distance command with an ACL for that route. Make the AD higher from the neighbor you don't want the route installed from.

1811W(config-router)#do sh ip route 192.168.0.0

Routing entry for 192.168.0.0/24

Known via "ospf 100", distance 110, metric 11, type intra area

Last update from 10.12.201.5 on Tunnel0, 00:00:10 ago

Routing Descriptor Blocks:

* 10.12.201.5, from 192.168.0.1, 00:00:10 ago, via Tunnel0

Route metric is 11, traffic share count is 1

1811W(config-router)#do sh ip ospf neigh

Neighbor ID Pri State Dead Time Address Interface

10.12.201.2 0 FULL/DROTHER 00:00:32 10.12.201.2 Tunnel0

10.12.201.3 0 FULL/DROTHER 00:00:35 10.12.201.3 Tunnel0

192.168.0.1 0 FULL/DROTHER 00:00:32 10.12.201.5 Tunnel0

1811W(config-router)#distance 111 192.168.0.1 0.0.0.0

1811W(config-router)#do sh ip route 192.168.0.0

Routing entry for 192.168.0.0/24

Known via "ospf 100", distance 111, metric 11, type intra area

Last update from 10.12.201.5 on Tunnel0, 00:00:07 ago

Routing Descriptor Blocks:

* 10.12.201.5, from 192.168.0.1, 00:00:07 ago, via Tunnel0

Route metric is 11, traffic share count is 1

Note the distance is now 111. In the example above you would apply an ACL to the end of the distance command for that specific route you want to break the redundant path for. Note you use the RID of the neighbor from which you want to influence. Here is the details on the command:

http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124tcr/tirp_r/rte_piht.htm#wp1180727

Enjoy

Anthony

Mel Popple Wed, 03/28/2007 - 10:25

Thanks for the tip, I will give it a go and let you kow the result.

Actions

This Discussion