OSPF Commands 741
auto-cost
By default, OSPF computes the link cost of each interface from the interface bandwidth. The 
link cost is computed as the ratio of a “reference bandwidth” to the interface bandwidth (ref_bw 
/ interface bandwidth), where interface bandwidth is defined by the “bandwidth” command. 
Because the default reference bandwidth is 100 Mbps, OSPF uses the same default link cost for 
all interfaces whose bandwidth is 100 Mbps or greater. To change the reference bandwidth, use 
the auto-cost command, specifying the reference bandwidth in megabits per second. The 
different reference bandwidth can be independently configured for OSPFv2 and OSPFv3.
Syntax
auto-cost reference-bandwidth 
ref_bw
•
ref_bw
 — The reference bandwidth in Mbps (Range: 1–4294967).
Default Configuration
The default reference bandwidth is 100 Mbps.
Command Mode
OSPFv2 or OSPFv3 Router Configuration mode.
User Guidelines
There are no user guidelines for this command.
Example
The following example configures a reference bandwidth of 500 Mbps.
console(config-router)#auto-cost reference-bandwidth 500
bandwidth
By default, OSPF computes the link cost of an interface as the ratio of the reference bandwidth 
to the interface bandwidth. Reference bandwidth is specified with the auto-cost command. For 
the purpose of the OSPF link cost calculation, the bandwidth command specifies the interface 
bandwidth. The bandwidth is specified in kilobits per second. If no bandwidth is configured, the 
bandwidth defaults to the actual interface bandwidth for port-based routing interfaces and to 10 
Mbps for VLAN routing interfaces. This command does not affect the actual speed of an 
interface.
Syntax
bandwidth 
bw
•
bw
 — Interface bandwidth in Kbps (Range: 1–10000000).