OSPF uses a reference bandwidth of 100 Mb/s for any links that are equal to or faster than a fast Ethernet connection. Therefore, the cost assigned to a fast Ethernet interface with an interface bandwidth of 100 Mb/s would equal 1.

Cost = 100,000,000 bps / 100,000,000 = 1

While this calculation works for fast Ethernet interfaces, it is problematic for links that are faster than 100 Mb/s; because the OSPF metric only uses integers as its final cost of a link. If something less than an integer is calculated, OSPF rounds up to the nearest integer. For this reason, from the OSPF perspective, an interface with an interface bandwidth of 100 Mb/s (a cost of 1) has the same cost as an interface with a bandwidth of 100 Gb/s (a cost of 1).

To assist OSPF in making the correct path determination, the reference bandwidth must be changed to a higher value to accommodate networks with links faster than 100 Mb/s.

Adjusting the Reference Bandwidth

Changing the reference bandwidth does not actually affect the bandwidth capacity on the link; rather, it simply affects the calculation used to determine the metric. To adjust the reference bandwidth, use the auto-cost reference-bandwidth Mb/s router configuration command. This command must be configured on every router in the OSPF domain. Notice that the value is expressed in Mb/s; therefore, to adjust the costs for:

To return to the default reference bandwidth, use the auto-cost reference-bandwidth 100 command.

The table in Figure 1 displays the OSPF cost if the reference bandwidth is set to Gigabit Ethernet. Although the metric values increase, OSPF makes better choices because it can now distinguish between FastEthernet and Gigabit Ethernet links.

Figure 2 displays the OSPF cost if the reference bandwidth is adjusted to accommodate 10 Gigabit Ethernet links. The reference bandwidth should be adjusted anytime there are links faster than FastEthernet (100 Mb/s).

Note: The costs represent whole numbers that have been rounded down.

In Figure 3, all routers have been configured to accommodate the Gigabit Ethernet link with the auto-cost reference-bandwidth 1000 router configuration command. The new accumulated cost to reach the R2 LAN 172.16.2.0/24 from R1:

Use the show ip ospf interface s0/0/0 command to verify the current OSPF cost assigned to the R1 serial 0/0/0 interface, as shown in Figure 4. Notice how it displays a cost of 647.

The routing table of R1 in Figure 5 confirms that the metric to reach the R2 LAN is a cost of 648.