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.
1 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.
1234567891011 R1#sh ip ospf inter briefInterface PID Area IP Address/Mask Cost State Nbrs F/CFa0/0 1 0 192.0.2.1/24 10 DR 0/0R1#conf tEnter configuration commands, one per line. End with CNTL/Z.R1(config)#int f0/0R1(config-if)#bandwidth 10R1(config-if)#do show ip ospf interf briefInterface PID Area IP Address/Mask Cost State Nbrs F/CFa0/0 1 0 192.0.2.1/24 10000 DR 0/0R1(config-if)#
Set the reference bandwidth – This changes the numerator of the calculation.
1234567 R1(config-if)#router ospf 1R1(config-router)#auto-cost reference-bandwidth 74362% OSPF: Reference bandwidth is changed.Please ensure reference bandwidth is consistent across all routers.R1(config-router)#do show ip ospf interface briefInterface PID Area IP Address/Mask Cost State Nbrs F/CFa0/0 1 0 192.0.2.1/24 7436 DR 0/0
Notice the nice message about making the reference bandwidth consistent. If you were to only set the reference bandwidth on this one routers, then each router would calculate the path costs differently. That will lead to undesirable results, I imagine.
SPF calculation overhead questions to me.