auto-cost reference-bandwidth (OSPFv3)

Configures reference bandwidth.

auto-cost reference-bandwidth value
no auto-cost reference-bandwidth

Reference bandwidth is 100 Mbps.

value
Reference bandwidth in Mbps. Valid values range from 1 through 4294967. The default is 100 Mbps.

OSPFv3 router configuration mode

OSPFv3 router VRF configuration mode

Use this command to configure the cost of an interface that a device advertises to it's OSPF neighbors. OSPFv3 calculates the cost of a route as the ratio of the reference bandwidth to the bandwidth of the egress interface. An increase in the reference bandwidth results in an increased cost. If the resulting cost is less than 1, the software rounds the cost up to 1.

The bandwidth for interfaces that consist of more than one physical port is calculated as follows:

  • LAG group — The combined bandwidth of all the ports.
  • Virtual (Ethernet) interface — The combined bandwidth of all the ports in the port-based VLAN that contains the virtual interface.

If a change to the reference bandwidth results in a cost change to an interface, the device sends a link-state update to update the costs of interfaces advertised by the device.

Note: If you specify the cost for an individual interface using the ipv6 ospf cost command, the cost you specify overrides the cost calculated by the software.

Some interface types are not affected by the reference bandwidth and always have the same cost regardless of the reference bandwidth in use:

  • The cost of a loopback interface is always 1.
  • The cost of a virtual link is calculated using the Shortest Path First (SPF) algorithm and is not affected by the auto-cost feature.
  • The bandwidth for tunnel interfaces is 9 Kbps and is subject to the auto-cost feature.

The no form of the command restores the reference bandwidth to its default value and, thus, restores the default costs of the interfaces to their default values.

The following example configures a reference bandwidth of 500.


device# configure terminal
device(config)# ipv6 router ospf
device(config-ospf6-router)# auto-cost reference-bandwidth 500
 

The reference bandwidth specified in this example results in the following costs:

  • 10 Mbps port’s cost = 500/10 = 50.
  • 100 Mbps port’s cost = 500/100 = 5.
  • 1000 Mbps port’s cost = 500/1000 = 0.5, which is rounded up to 1.
  • 155 Mbps port cost = 500/155 = 3.23, which is rounded up to 4
  • 622 Mbps port cost = 500/622 = 0.80, which is rounded up to 1
  • 2488 Mbps port cost = 500/2488 = 0.20, which is rounded up to 1

The costs for 10 Mbps, 100 Mbps, and 155 Mbps ports change as a result of the changed reference bandwidth. Costs for higher-speed interfaces remain the same.