OSPF routes update manipulation

Unanswered Question
May 21st, 2007
User Badges:

Hi collegues,

I am trying to set the metric of an OSPF route using a route-map with a set metric command I used the commands as follows

router ospf 100

distribute-list route-map set_metric in

route-map set_metric permit 10

match ip next-hop X.X.X.X

set metric 47

access-list 1 permit ip X.X.X.X

I get matches on the acl but the metric is never cahnged, can you please help me out.



  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Harold Ritter Mon, 05/21/2007 - 13:13
User Badges:
  • Cisco Employee,


the distribute-list allows you to permit or deny routes from the LSDB to the routing table. It doesn't allow to set the metric or any other route attributes.

What is it that you are you trying to achieve?


Mohamed Mahmoud... Mon, 05/21/2007 - 22:50
User Badges:


I am trying to load balance on two unequal cost paths advertised within the OSPF, I know that the EIGRP can do that but I want to acheive the same result on an OSPF cloud.

The Scenario I have is 2 redundant routers (primary & secondary) with HSRP on LAN, each gets OSPF updates from the peer router in the main site, the primary router gets the route with cost 48 over an E1 link and the same route is advertised from the Secondary router with cost 49, I want to force the cost of the route advertised by secondary router to 48 to be installed in the routing table and acheive load balancing.

Any ideas how can I acheive this?



mohammedmahmoud Tue, 05/22/2007 - 10:12
User Badges:
  • Green, 3000 points or more

Hi Mohamed,

You know that OSPF uses the BW command under the interface to calculate the cost, try manipulating the BW command under your interfaces or using the "ip ospf cost" command in order for OSPF to calculate equal cost on both links and accordingly load balances over them.

P.S: I recommend using the "ip ospf cost" rather than the BW, as if you changed the BW, this might affect other Cisco IOS features like QoS.

HTH, please do rate all helpful replies,

Mohammed Mahmoud.

Mohamed Mahmoud... Tue, 05/22/2007 - 22:35
User Badges:

Hi Mohamed,

I did try using the ospf cost command for the secondry interface and it did acheive load balancing over the two paths for ouging traffic, but by doing this on the Secondary interfaces of all the sites it caused an unpredictable routing behaviour over the OSPF cloud, for example, any flow going over the secondary link (due to load balance) and is directed to a destination site other than the hub site it prefers to go along the secondry path all through the network, as the reduction of cost accumulates making the secondry path more preferred, i.e: load balancing was acheived for outgoing traffic only.

mohammedmahmoud Tue, 05/22/2007 - 22:50
User Badges:
  • Green, 3000 points or more

Hi Mohamed,

This is logical, as you need to manipulated the cost on both sides to control both the incoming and the outgoing traffic, you can never have it done only from one side, manipulating the OSPF cost needs a good visualization of the network and caution when doing the changes in order not to introduce any instability to the OSPF cloud.

HTH, please do rate all helpful replies,

Mohammed Mahmoud.

minumathur Mon, 05/21/2007 - 20:13
User Badges:
  • Bronze, 100 points or more


May be below command will help you.

redistribute static metric 47 metric-type 1 subnets route-map static-filter.

There are two metric type extenal type 1) E1 2) E2



This Discussion