So, the cost is based on the bandwidth value only, changing the bandwidth value will affect the cost, for example, if you change the bandwidth values as you see in the picture below,
Now,
Cost(Metric) From site1 router to reach site2 network 10.10.12.0/24
Metric=10^8bps/BW in bps
Metric=100000kbps/Bw in kbps+100000/BW in kbps
Metric=100000kbps/800+100000/1200=125+83
Metric=208
Cost(Metric) From site2 router to reach site2 network 10.10.10.0/24
Metric=10^8bps/BW in bps
Metric=100000kbps/Bw in kbps+100000/BW in kbps
Metric=100000/700+100000/900=142+111
Metric=253
Site1#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C 10.10.10.0/24 is directly connected, FastEthernet0/0
C 10.10.11.0/30 is directly connected, Serial0/0/0
O 10.10.12.0/24 [110/208] via 10.10.11.2, 02:15:25, Serial0/0/0
Site2#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
O 10.10.10.0/24 [110/253] via 10.10.11.1, 00:07:18, Serial0/0/0
C 10.10.11.0/30 is directly connected, Serial0/0/0
C 10.10.12.0/24 is directly connected, FastEthernet0/1
The other way to change the cost value, using ip ospf cost command, The value set by the ip ospf cost command overrides the cost resulting from the calculation matter 10^8/Bw in bps.
For example, if you want to change the cost value of the interface f0/0 of site1 router to 20
Site1(config)#int f0/0
Site1(config-if)#ip ospf cost 20
So, the cost of f0/0 was 100000/9000=111, but after using the above command will be 20, this mean that Cost(Metric) From site2 router to reach site2 network 10.10.10.0/24
Metric=10^8bps/BW in bps
Metric=100000kbps/Bw in kbps+100000/BW in kbps
Metric=100000/700+20=142+20
Metric=162
Site2#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
O 10.10.10.0/24 [110/162] via 10.10.11.1, 00:06:00, Serial0/0/0
C 10.10.11.0/30 is directly connected, Serial0/0/0
C 10.10.12.0/24 is directly connected, FastEthernet0/1
Also, you can change the reference bandwidth, which will affect the cost by using the
auto-cost reference-bandwidth mbps.
Also, you can cha If you have high bandwidth links, you should use a larger number of reference bandwidth to differentiate the cost of these links. It's important to know that the value set by ip ospf cost command will override the cost resulting from the auto-cost command.