auto-cost reference-bandwidth [mbps]
Sets the reference bandwidth used by OSPF to calculate the cost of an interface, overriding the default 100 Mbps reference, to ensure accurate metric calculation for higher-speed links.
auto-cost reference-bandwidth [mbps]When to Use This Command
- Adjusting OSPF cost calculation when network includes Gigabit Ethernet or 10 Gigabit Ethernet links to avoid equal-cost paths.
- Standardizing OSPF metrics across a mixed-speed network to ensure proper path selection.
- Preparing for migration from FastEthernet to Gigabit Ethernet without changing interface costs manually.
- Troubleshooting suboptimal routing due to default reference bandwidth causing equal-cost paths on dissimilar speed links.
Command Examples
Set reference bandwidth to 1000 Mbps for Gigabit Ethernet
auto-cost reference-bandwidth 1000R1(config-router)# auto-cost reference-bandwidth 1000 % OSPF: Reference bandwidth is changed to 1000 Mbps % Please ensure reference bandwidth is consistent across all routers R1(config-router)#
The command sets the reference bandwidth to 1000 Mbps. The output warns that this change affects OSPF cost calculation and must be consistent across all routers in the OSPF domain to avoid routing loops.
Verify OSPF interface cost after changing reference bandwidth
show ip ospf interface gigabitethernet0/0GigabitEthernet0/0 is up, line protocol is up
Internet Address 192.168.1.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 1.1.1.1, Interface address 192.168.1.1
Backup Designated router (ID) 2.2.2.2, Interface address 192.168.1.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:03
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 25
Last flood scan time is 0 msec, maximum is 4 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 2.2.2.2 (Backup Designated Router)
Suppress hello for 0 neighbor(s)The output shows the OSPF interface details. The 'Cost: 1' line indicates the calculated cost using the new reference bandwidth (1000 Mbps / 1000 Mbps = 1). This confirms the change took effect.
Understanding the Output
The command itself does not produce persistent output; it only displays a warning message. To verify the effect, use 'show ip ospf interface' to see the calculated cost per interface. The cost is computed as reference bandwidth / interface bandwidth. For example, with reference bandwidth 1000 Mbps, a GigabitEthernet interface (1000 Mbps) gets cost 1, while a FastEthernet (100 Mbps) gets cost 10. Ensure all routers in the OSPF domain use the same reference bandwidth to maintain consistent metric calculations. A common mistake is forgetting to apply the command on all routers, leading to asymmetric routing or suboptimal path selection.
CCNA Exam Tips
CCNA exam tip: The default reference bandwidth is 100 Mbps; you must change it if your network has links faster than 100 Mbps to avoid equal-cost paths.
CCNA exam tip: The 'auto-cost reference-bandwidth' command is configured in router configuration mode, not interface configuration mode.
CCNA exam tip: Changing reference bandwidth affects all OSPF interfaces; you cannot apply it per interface.
CCNA exam tip: The cost formula is cost = reference-bandwidth / interface-bandwidth; if the result is less than 1, it is rounded up to 1.
Common Mistakes
Mistake 1: Forgetting to apply the same reference bandwidth on all OSPF routers, causing inconsistent metrics and potential routing loops.
Mistake 2: Setting the reference bandwidth too low (e.g., 100 Mbps) on a network with 10 Gbps links, resulting in all links having cost 1 and losing path selection granularity.
Mistake 3: Using the command in interface configuration mode instead of router configuration mode, which results in an error.
Related Commands
ip ospf cost [value]
Manually sets the OSPF cost (metric) on an interface, overriding the default cost derived from bandwidth, to influence path selection in OSPF routing.
show ip ospf interface
Displays OSPF interface parameters and status, used to verify OSPF configuration and troubleshoot neighbor relationships.
show ip route
Displays the current IP routing table on a Cisco router, used to verify routes, check next-hop addresses, and troubleshoot connectivity issues.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions