auto-cost reference-bandwidth sets the OSPF reference bandwidth used to calculate interface costs automatically. OSPF calculates cost by dividing the reference bandwidth by link bandwidth; the default reference bandwidth is 100 Mbps, so faster links can receive the same cost and cause undesirable ECMP. section 18.1.3 section 18.5
Use the command in OSPF router configuration mode to:
- Set a value such as 1000 Mbps, giving GigabitEthernet links a cost of 1 and FastEthernet links a cost of 10. section 18.1.3
- Apply the same reference bandwidth on every OSPF router; inconsistent values can produce inconsistent route selection and routing loops. section 18.1.3
- Choose a value matching the fastest link, or choose a higher value to accommodate faster future links. section 18.1.3
Cisco IOS configuration
R1(config)# router ospf 1 R1(config-router)# auto-cost reference-bandwidth 1000 % OSPF: Reference bandwidth is changed. Please ensure reference bandwidth is consistent across all routers. Verify results with: show ip ospf interface brief section 18.1.3
R1# show ip ospf interface brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Gi0/0 1 0 10.0.0.1/30 1 DR 1/1 #1
Fa1/0 1 0 10.0.0.5/30 1 DR 1/1 #1
R1# configure terminal
R1(config)# router ospf 1 #2
R1(config-router)# auto-cost reference-bandwidth 1000 #3
% OSPF: Reference bandwidth is changed. #4
Please ensure reference bandwidth is consistent
across all routers. #4
R1(config-router)# do show ip ospf interface brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Gi0/0 1 0 10.0.0.1/30 1 DR 1/1 #5
Fa1/0 1 0 10.0.0.5/30 10 DR 1/1 #5
#1 G0/0 and F1/0 have identical costs: 1.
#2 Enters OSPF router config mode
#3 Sets the reference bandwidth to 1000 Mbps (1 Gbps)
#4 IOS gives a warning message.
#5 G0/0’s cost remains at 1, but F1/0’s cost is now 10.
Inspect the command sequence and compare interface costs before and after changing the reference bandwidth. section 18.1.3
