OSPF Reference Bandwidth
OSPF uses a simple formula to calculate the OSPF cost for an interface with this formula:
cost = reference bandwidth / interface bandwidth
The reference bandwidth is a value in Mbps that we can set ourselves. By default, this is 100Mbps on Cisco IOS routers. The interface bandwidth is something we can look up.
Let’s take a look at an example of how this works. I’ll use this router:

The router above has two interfaces, a FastEthernet and a serial interface:
R1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.1.1 YES manual up up
Serial0/0 192.168.2.1 YES manual up up
Let’s enable OSPF on these interfaces:
R1(config)#router ospf 1
R1(config-router)#network 192.168.1.0 0.0.0.255 area 0
R1(config-router)#network 192.168.2.0 0.0.0.255 area 0
After enabling OSPF, we can check what the reference bandwidth is:
Router#show ip ospf | include Reference
Reference bandwidth unit is 100 mbps
By default, this is 100 Mbps. Let’s see what cost values OSPF has calculated for our two interfaces:
Router#show interfaces FastEthernet 0/0 | include BW
MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec
Router#show ip ospf interface FastEthernet 0/0 | include Cost
Process ID 1, Router ID 192.168.1.1, Network Type BROADCAST, Cost: 1
The FastEthernet interface has a bandwidth of 100,000 kbps (100 Mbps), and the OSPF cost is 1. The formula to calculate the cost looks like this:
100.000 kbps reference bandwidth / 100.000 interface bandwidth = 1
What about the serial interface? Let’s find out:
R1#show interfaces Serial 0/0 | include BW
MTU 1500 bytes, BW 1544 Kbit/sec, DLY 20000 usec,
R1#show ip ospf interface Serial 0/0 | include Cost
Process ID 1, Router ID 192.168.2.1, Network Type POINT_TO_POINT, Cost: 64
The serial interface has a bandwidth of 1.544 kbps (1.5 Mbps) and a cost of 64. It was calculated like this:
100,000 kbps reference bandwidth / 1,544 kbps interface bandwidth = 64.76
It was rounded down to 64.
The default reference bandwidth of 100 Mbps can cause issues if you use Gigabit or 10 Gigabit interfaces. The lowest possible cost value is one so with the default reference bandwidth, a FastEthernet, Gigabit, and 10 Gigabit interface would have an OSPF cost of 1.
If you use Gigabit interfaces (or 10 Gigabit), then it’s better to change the reference bandwidth. You can do it like this:
Router(config-router)#auto-cost reference-bandwidth ?
<1-4294967> The reference bandwidth in terms of Mbits per second
Use the auto-cost reference-bandwidth
command and specify the value you want in Mbps. Let’s set it to 1000 Mbps:
Router(config-router)#auto-cost reference-bandwidth 1000
% OSPF: Reference bandwidth is changed.
Please ensure reference bandwidth is consistent across all routers
Cisco IOS will warn you that you should do this on all OSPF routers. Let’s verify our work:
Router#show ip ospf | include Reference
Reference bandwidth unit is 1000 mbps
Our reference bandwidth is now 1000 Mbps. Let’s see what the cost of our FastEthernet is now:
Router#show ip ospf interface FastEthernet 0/0 | include Cost
Process ID 1, Router ID 192.168.1.1, Network Type BROADCAST, Cost: 10
Topology-MTID Cost Disabled Shutdown Topology Name
It now has a cost of 10 which means that a Gigabit interface would end up with a cost of 1.
Unit 1: Introduction to OSPF
- Introduction to OSPF
- Basic OSPF Configuration
- OSPF Multi Area Configuration
- OSPF Reference Bandwidth
- OSPF Plain Text Authentication
- OSPF MD5 Authentication
- OSPF SHA-HMAC Authentication
- OSPF TTL Security Check
- OSPF Default Route
Unit 2: OSPF Neighbor Adjacency
- OSPF LSA Types
- OSPF LSAs and LSDB Flooding
- OSPF Hello and Dead Interval
- OSPF Router ID
- OSPF Packets and Neighbor Discovery
- OSPF DR/BDR Election
- OSPF Passive Interface
- Troubleshooting OSPF Neighbor Adjacency
Unit 3: OSPF Network Types
- OSPF Non-Broadcast Network Type
- OSPF Broadcast Network Type
- OSPF Point-to-Multipoint Network Type
- OSPF Point-to-Multipoint Non-Broadcast Network Type
- OSPF Point-to-Point Network Type
- OSPF Next Hop with Network Types
Unit 4: OSPF Stub Areas
- Introduction to OSPF Stub Areas
- How to configure OSPF Stub Area
- How to configure OSPF Totally Stub
- How to configure OSPF NSSA (Not So Stubby) Area
- How to configure OSPF Totally NSSA (Not So Stubby) Area
- OSPF NSSA P-bit explained
Unit 5: Advanced OSPF Topics
- OSPF Summarization
- OSPF Distribute-List Filtering
- OSPF LSA Type 3 Filtering
- OSPF LSA Type 5 Filtering
- OSPF Virtual Link
- OSPF Virtual Link Authentication
- OSPF Path Selection Explained
- How to read the OSPF Database
- OSPFv3 for IPv4
- Troubleshooting OSPF Route Advertisement
- OSPF SPF Scheduling and Throttling
- OSPF LSA Throttling
- OSPF Incremental SPF
- OSPF Prefix Suppression
- OSPF Stub Router
- OSPF Graceful Shutdown
- OSPF Graceful Restart
- OSPF Loop-Free Alternate (LFA) Fast Reroute (FRR)
- OSPF Remote Loop-Free Alternate (LFA) Fast Reroute (FRR)