Summary Post – Methods to Manipulate OSPF Costs
There are three ways to manipulate the interface cost in OSPF. One is very direct, one changes the presentation of the interface, and the other changes the calculations for every interface.
Set the cost of the interface directly – Just give it the number you want. Easy. This is the number OSPF will use in the SPF calculations without doing any math on the interface.
R1(config-if)#ip ospf cost 8482
Set the bandwidth of the interface – The formula that OSPF uses to calculate interface cost is pretty easy to remember – (reference bandwidth) / (interface bandwidth). Changing the interface bandwidth will obviously change the result of the calculation. The same caveat for EIGRP route manipulation holds true here; if you change the bandwidth of the interface, you may affect other things like QoS…or EIGRP, now that I mention it.
R1#sh ip ospf inter brief Interface PID Area IP Address/Mask Cost State Nbrs F/C Fa0/0 1 0 192.0.2.1/24 10 DR 0/0 R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#int f0/0 R1(config-if)#bandwidth 10 R1(config-if)#do show ip ospf interf brief Interface PID Area IP Address/Mask Cost State Nbrs F/C Fa0/0 1 0 192.0.2.1/24 Continue reading
