ospf metric strange plz help

Unanswered Question
Jun 10th, 2007

hi guys plz look at the figure below


O---------------------O R2





now see that i am running ospf on all 3 routers in area 0, i want to assign metric of 10 to network when its advertised to R2 by R1, how can i do that ??? i tried redistribute connected but didnt work and i know why, so now how can i do it ????

plz tell me

thanks in advance

plz give me the complete configuration thank u

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
oj88 Sun, 06/10/2007 - 06:48

If you want to override the computed cost or metric in ospf, use the following command:

ip ospf cost 10

Put this on the interface config on R1 facing R3. Not sure if you need to configure this also on R3's interface facing R1. My ospf is getting kinda rusty.

Another way is to play with the bandwidth command. More info here: http://www.cisco.com/en/US/partner/products/ps6350/products_command_reference_chapter09186a0080446b1b.html#wp1000369

royalblues Sun, 06/10/2007 - 09:11


R3 will calculate the metric to the network as a sum of the metric advertised by R2 and the link cost between R2 & R3

Say for eg . Cost betwen R1 & R2 is 64 and cost between R2 and R3 is also 64

so R3 will have a metric of 128 to the network

Now if you use ip ospf cost 10 on the R2 interface connecting to R1, then R1 will add this cost to the cost associated with the link between r1 i.e the metric will be shown as 74 (i.e 64 + 10)

If you want to have R3 calculate the metric as 10 then you will have to manipulate the cost between both the routers to add as 10.

HTH, rate if it does


Edison Ortiz Sun, 06/10/2007 - 15:28

ip ospf cost 5 on the and interfaces in R1 should do the job.

shaila_rox Sun, 06/10/2007 - 23:04

ok thank u guys actually i was expecting some command like route map or something, i knew abt the cost, ok let me elaborate my question then plz tell me, consider the same diagram now i have added 1 more router R4 again with R1 ( perhaps to its s1 interface ) now like u guys said if i change the cost of R1 interface then this cost will be advertised to both R2 and R4 right ?? wat if i want to change the metric of just R2 ?? i know again that i can do it but changing the cost of R2 right ?? is there ANY OTHER way ??? coz u see the cost is advertised in the LSA so is there any way i can change the advertised cost but not actually changing the interface cost,

plz tell me again

thanks a lot for ur feedback all of u but plz guide me in this

royalblues Sun, 06/10/2007 - 23:35

ok i got your point. Will try to simulate and let you know


Edison Ortiz Mon, 06/11/2007 - 05:43

On this case, you would have to run 2 OSPF instances on R1 and do a redistribute connected under the OSPF process being shared with R2.



router ospf 1

network area 0

router ospf 2

network area 0

redistribute connected subnets route-map metric metric 10

route-map metric permit 10

match ip address R3

ip access-list standard R3



router ospf 2

network area 0


router ospf 1

network area 0

shaila_rox Tue, 06/12/2007 - 04:05

thank u edison, i m still waiting for narayan to see if he comes with something other than this, probably working in the same ospf process, or if some 1 have anyother idea to do it plz tell me

thanks alot to all who replied

thank u very much


This Discussion