OSPF cost could be set explicitly or calculated automatically using the link’s bandwidth and OSPF reference bandwidth. In this tutorial, I explain the definition of OSPF reference bandwidth, how to adjust it, and more.
Upon the completion of this lesson, you will be able to answer the following questions:
- What is reference bandwidth in OSPF?
- What is the function of the auto-cost reference-bandwidth command?
- Why would you want to change the OSPF default reference bandwidth?
- How do I change the reference bandwidth in OSPF?
- How does OSPF calculate its metric or cost?
- How does OSPF check reference bandwidth?
- How does OSPF determine the cost of an interface?
- How does OSPF reference bandwidth get used?
- How to use the auto-cost reference-bandwidth command?


In the rest of this tutorial, we use the following network topology consisting of 4 routers. All interfaces belong to area 0, and the bandwidths of some interfaces have been changed to demonstrate facts related to OSPF reference bandwidth.
| Router | Interface | Bandwidth |
| R3 | FastEthernet 0/1 | 2.5Gbps |
| R4 | GigabitEthernet 0/0 | 10Gbps |
| R4 | Serial 1/0 | 56kbps |
Here are the links to download the configurations applied to the routers.
| Router R1 | Router R2 | Router R3 | Router R4 |
What is OSPF Reference Bandwidth?
OSPF reference bandwidth is a value OSPF uses along with bandwidth to calculate the link’s cost if the cost was not set manually. By default, OSPF divides the reference bandwidth by the bandwidth and assigns the resulting value to the link’s cost.
OSPF Cost = (OSPF Reference Bandwidth) / (Link Bandwidth)
100 Mbps is the default value for OSPF reference bandwidth on Cisco IOS, IOS-XE, and IOS-XR.
Link Bandwidth depends on the interface type (Loopback, T1, Ethernet, Fast Ethernet, Gigabit Ethernet, 10-Gigabit Ethernet, Serial, OC48, etc) by default. The table below shows the default bandwidth for several interface types and the corresponding cost based on different OSPF reference bandwidth values.
| Interface Type | Default Bandwidth | OSPF Cost | ||
| Reference bandwidth of 100Mbps | Reference bandwidth of 1Gbps | Reference bandwidth of 10Gbps | ||
| Loopback | 8000000 | 1 | 1 | 1 |
| Serial | 56 | 1785 | 17857 | 178571 |
| T1 | 1544 | 64 | 647 | 6476 |
| Ethernet | 10000 | 10 | 100 | 1000 |
| Fast Ethernet | 100000 | 1 | 10 | 100 |
| Gigabit Ethernet | 1000000 | 1 | 1 | 10 |
| OC48 | 2500000 | 1 | 1 | 4 |
| 10-Gigabit Ethernet | 10000000 | 1 | 1 | 1 |
When the value of OSPF Reference Bandwidth is lower than the link’s bandwidth, OSPF sets the cost to 1. For example, with OSPF reference bandwidth equal to 100 Mbps, loopback, Gigabit Ethernet, OC48, and 10-Gigabit Ethernet interfaces get an OSPF of 1 (Examples 1, 2, 3, and 4 )
R1# show interfaces loopback 0
Loopback0 is up, line protocol is up
Hardware is Loopback
Internet address is 10.0.1.1/24
MTU 1514 bytes, BW 8000000 Kbit/sec, DLY 5000 usec,
omitted output
R1# show ip ospf interface loopback 0
Loopback0 is up, line protocol is up
Internet Address 10.0.1.1/24, Area 0
Process ID 1, Router ID 10.0.1.1, Network Type LOOPBACK, Cost: 1
Loopback interface is treated as a stub Host
Example 1 – Displaying the bandwidth and OSPF cost of R1’s loopback 0 interface
R2# show interfaces gigabitEthernet 0/0
GigabitEthernet0/0 is up, line protocol is up
Hardware is i82543 (Livengood), address is ca02.0888.0008 (bia ca02.0888.0008)
Internet address is 10.0.12.2/24
MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec,
reliability 255/255, txload 1/255, rxload 1/255
omitted output
R2# show ip ospf interface gigabitEthernet 0/0
GigabitEthernet0/0 is up, line protocol is up
Internet Address 10.0.12.2/24, Area 0
Process ID 1, Router ID 10.0.24.2, Network Type BROADCAST, Cost: 1
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
omitted output
Example 2 – Displaying the bandwidth and OSPF cost of R2’s GigabitEthernet 0/0 interface
R3# show interfaces fastethernet 0/1
FastEthernet0/1 is up, line protocol is up
Hardware is AmdFE, address is cc03.089c.0001 (bia cc03.089c.0001)
Internet address is 10.0.34.3/24
MTU 1500 bytes, BW 2500000 Kbit/sec, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
omitted output
R3# show ip ospf interface fastethernet 0/1
FastEthernet0/1 is up, line protocol is up
Internet Address 10.0.34.3/24, Area 0
Process ID 1, Router ID 10.0.34.3, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State BDR, Priority 1
omitted output
Example 3 – Displaying the bandwidth and OSPF cost of R3’s FastEthernet 0/1 interface
R4# show interfaces gigabitEthernet 0/0
GigabitEthernet0/0 is up, line protocol is up
Hardware is i82543 (Livengood), address is ca04.063f.0008 (bia ca04.063f.0008)
Internet address is 10.0.34.4/24
MTU 1500 bytes, BW 10000000 Kbit/sec, DLY 10 usec,
omitted output
R4# show ip ospf interface gigabitEthernet 0/0
GigabitEthernet0/0 is up, line protocol is up
Internet Address 10.0.34.4/24, Area 0
Process ID 1, Router ID 10.0.34.4, Network Type BROADCAST, Cost: 1
omitted output
Example 4 – Displaying the bandwidth and OSPF cost of R4’s GigabitEthernet 0/0 interface
Default OSPF Reference Bandwidth
The default OSPF reference bandwidth on Cisco IOS is 100Mbps. The table below provides the default OSPF reference bandwidth on different router operating systems.
| Router OS | Default OSPF Reference Bandwidth |
| Cisco IOS | 100Mbps |
| Cisco IOS XE | 100Mbps |
| Cisco IOS XR | 100Mbps |
| Cisco NX-OS | 40Gbps |
| Juniper JunOS | 100Mbps |
Adjusting OSPF Reference Bandwidth on Cisco IOS
The goal of adjusting OSPF reference bandwidth is to best calculate the OSPF cost according to the interface’s bandwidth. On Cisco IOS, OSPF reference bandwidth can range from 1 to 4294967 Mbps. Using a small value will make all interfaces equal to OSPF while using a too-high value leads to very high OSPF costs that may exceed the maximum cost of 65535 that can be assigned to an interface. However, setting the OSPF reference bandwidth to the speed of the fastest router interface in the current OSPF domain would be enough.
The auto-cost reference-bandwidth bw allows changing the default value of OSPF reference bandwidth, where bw is a number between 1 and 4294967 in Mbps.
R2(config-router)# auto-cost reference-bandwidth 10000
To display the current OSPF reference bandwidth on a particular router, use the show ip ospf command (Example 6).
Finally, make sure that OSPF reference bandwidth is the same on all routers in the current OSPF autonomous system.
R2# show ip ospf
Routing Process "ospf 1" with ID 10.0.24.2
Start time: 00:03:49.320, Time elapsed: 00:41:10.548
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
Supports area transit capability
Event-log enabled, Maximum number of events: 1000, Mode: cyclic
Router is not originating router-LSAs with maximum metric
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
Incremental-SPF disabled
Minimum LSA interval 5 secs
Minimum LSA arrival 1000 msecs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 0. Checksum Sum 0x000000
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Number of areas transit capable is 0
External flood list length 0
IETF NSF helper support enabled
Cisco NSF helper support enabled
Reference bandwidth unit is 10000 mbps
Area BACKBONE(0)
Number of interfaces in this area is 2
Area has no authentication
SPF algorithm last executed 00:01:59.948 ago
SPF algorithm executed 7 times
Area ranges are
Number of LSA 7. Checksum Sum 0x02FB20
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
Example 5 – Displaying general information about OSPF
OSPF Issue Caused by OSPF Reference Bandwidth
When you adjust OSPF reference bandwidth manually, Cisco IOS displays the following message.
% OSPF: Reference bandwidth is changed.
Please ensure reference bandwidth is consistent across all routers.
Basically, configuring different OSPF reference bandwidth values on routers in the same OSPF routing domain would not cause routing loops. A routing loop occurs when router A forwards a packet, destined for a particular network, to a next-hop router B, which sends the packet back to A.
However, suboptimal routing may occur because links with lower bandwidth gets lower OSPF cost.
Related Articles
- Open Shortest Path First (OSPF) Explained: The Ultimate Guide for CCNA
- OSPF Router ID: Format, Selection Process, Purpose & Configuration
- OSPF Null Authentication: Configuration & Verification
- OSPF Clear/Plain Text Authentication: Definition and Configuration Example
- OSPF Default Route Explained: Cost, Metric Type and More
- Basic OSPF Configuration Lab for CCNA
- OSPF Configuration: from Basic Stuff to Advanced One
- OSPF Passive Interface: How to Set it Up on Cisco and Juniper
- OSPF Virtual Link Explained + Configuration Example on Cisco IOS
- OSPF Stub Area: Definition, Operation and Configuration
- OSPF LSA Types Tutorial: 6 Types Explained with Examples
- OSPF Graceful Restart: Operation & Configuration on Cisco IOS
- OSPF Totally Stubby Area: Operation and Configuration
- OSPF Cost: How OSPF Cost is Calculated and Configured?
- OSPF DR/BDR Election: Process, Configuration, and Tuning
- OSPF Hello and Dead Interval: Operation and Configuration on Cisco IOS
- OSPF Metric: Calculation and Tuning on Cisco IOS
- OSPF MD5 Authentication Explained + Configuration on Cisco IOS
- OSPF HMAC-SHA Cryptographic Authentication: Operation and Configuration
- OSPF Multi-Area Topology + a Configuration Lab in Cisco Packet Tracer
- OSPF TTL Security Check Explained: Operation, Example, and Configuration
- OSPF Graceful Shutdown: Operation and Configuration on Cisco IOS
- Route Redistribution Between OSPF and RIP
- OSPF Network Types Explained with Examples on Cisco IOS
- OSPF Totally NSSA (Not-So-Stubby Area) Area Explained with Examples on Cisco IOS
- OSPF NSSA (Not-So-Stubby Area) Area Explained + Configuration on Cisco IOS
- OSPF Summarization Explained + Configuration in Cisco IOS
- OSPF Route Filtering with Distribute Lists Explained + Configuration on Cisco IOS
- OSPF Type 5 LSA Filtering: Suppress LSA Type 5 and 7 Data on Cisco IOS Easily
- OSPF ABR Type 3 LSA Filtering Explained + Configuration on Cisco IOS
- OSPF Prefix Suppression Explained + Configuration on Cisco and Juniper Routers
- OSPF Path Selection: Criteria, Rules & Tiebreaker Explained on Cisco IOS
- OSPF LSA Throttling: Tuning LSA Origination on Cisco IOS
- OSPF SPF Throttling: Scheduling SPF Runs Efficiently
- OSPF Incremental SPF (iSPF) Algorithm: Rebuilding The SPT Tree Fast
- OSPF Non-Broadcast Network Type: Used on Frame-Relay & NBMA Networks
- OSPF Point-to-Point Network Type is for PPP & Frame-Relay Point-to-Point Links
- OSPF Broadcast Network Type: Used on Ethernet and also Frame-Relay
- OSPF Point-to-Multipoint Network Type is for Frame Relay and NBMA Links
- OSPF vs RIP: What Differences Between OSPF and RIP?
- OSPF LSA Group Pacing Explained + Timer Configuration on Cisco IOS
- OSPF LSA Flood Pacing Explained + Timer Configuration on Cisco IOS
- OSPF LSA Retransmission Pacing Explained + Timer Configuration on Cisco IOS
- Troubleshooting OSPF Neighbor Adjacency Problems on Cisco IOS
- Troubleshooting OSPF Route Installation Explained on Cisco IOS
- Troubleshooting OSPF Route Advertisement Explained on Cisco IOS
- OSPF Stub Router: Advertisement + Configuration + Examples



