Routing · 4 min read

OSPF cost reference bandwidth: why 100 Mbps links get cost 1

OSPF picks the best path by cost, and it derives that cost from a deceptively simple formula: reference bandwidth divided by interface bandwidth. The default reference bandwidth is 100 Mbps - and on modern links that default quietly breaks path selection.

The 100 Mbps problem

With a 100 Mbps reference, any interface at or above 100 Mbps works out to a cost of 1 - whether it is a 1 Gbps link, 10 Gbps, or 100 Gbps. OSPF costs are integers, so every fractional result rounds up to the minimum of 1.

100 Mbps link:  100 / 100   = 1
1 Gbps link:    100 / 1000  = 0.1  -> 1
10 Gbps link:   100 / 10000 = 0.01 -> 1

The result: OSPF cannot tell a 1 Gbps backbone from a 10 Gbps core. Both cost 1, so it has no reason to prefer the faster path and may load-balance across wildly unequal links or choose a slower route that happens to have fewer hops.

The fix: raise the reference bandwidth

Set the reference bandwidth to match your fastest link, and set it identically on every router in the area. If your core runs 100 Gbps, use 100000 - the value is in Mbps.

! Cisco IOS
router ospf 1
 auto-cost reference-bandwidth 100000

! Juniper Junos
set protocols ospf reference-bandwidth 100g

! Arista EOS
router ospf 1
 auto-cost reference-bandwidth 100000

With a 100 Gbps reference the costs finally reflect reality, and OSPF prefers the faster path:

Manual override when you need it

For fine-grained control, set the cost directly on an interface with ip ospf cost. That bypasses the automatic calculation entirely and works regardless of the reference bandwidth. Verify afterwards with show ip ospf interface brief and confirm the faster links carry the lower costs.

The 100 Mbps default made sense in 2000. On a mixed-speed network today it is a liability - audit your reference bandwidth, make it consistent across the area, and let OSPF route down the fast paths.

OSPF Cost Calculator
Enter interface and reference bandwidth, get the exact cost.
Open →
Practise this on today’s Daily Ops Drill — a free network task every day.
Open the app →
Free tools for this
More from the blog
MTU, MSS, and why your VPN tunnels drop large packetsRead →169.254.x.x address on your interface: what APIPA really meansRead →