OSPF-Kosten-Rechner - Berechnen Sie OSPF-Interface-Kosten aus Bandbreite
← Back to Main Calculator

OSPF Cost Calculator

Calculate the OSPF metric cost of an interface based on bandwidth.

or custom:Kbps
OSPF Cost
1

OSPF Cost Reference (Default Reference 100 Mbps)

Interface SpeedBandwidthOSPF Cost
56 Kbps56 Kbps1785
64 Kbps64 Kbps1562
128 Kbps128 Kbps781
T1 (1.544 Mbps)1544 Kbps64
E1 (2 Mbps)2000 Kbps50
Ethernet (10 Mbps)10000 Kbps10
DS3 (45 Mbps)45000 Kbps2
Fast Ethernet (100 Mbps)100000 Kbps1
Gigabit Ethernet (1 Gbps)1000000 Kbps1
10 Gigabit Ethernet10000000 Kbps1

Understanding OSPF Cost Calculation

OSPF (Open Shortest Path First) uses a metric called cost to determine the best path to a destination network. The cost is inversely proportional to the interface bandwidth — higher bandwidth links have lower costs and are preferred for routing.

The basic formula is: Cost = Reference Bandwidth ÷ Interface Bandwidth. The result is always an integer; fractional results are rounded up to 1 (minimum cost). For example, with the default reference of 100 Mbps, a 10 Mbps Ethernet link gets a cost of 10, while a 100 Mbps Fast Ethernet link gets a cost of 1.

Important: Interfaces operating at or above the reference bandwidth will all have a cost of 1, making them indistinguishable for path selection. This is why modern networks should use a higher reference bandwidth (1000 Mbps for 1 Gbps links, 10000 Mbps for 10 Gbps links).

OSPF also supports delay, reliability, and load as optional metrics, but bandwidth-based cost is the default and most commonly used metric for path selection.


Frequently Asked Questions

Can OSPF cost be manually configured?

Yes. Use the interface subcommand ip ospf cost <value> on Cisco routers to override the auto-calculated cost. This is useful for influencing path selection without changing bandwidth values.

How is OSPF path cost calculated?

The total cost of an OSPF route is the sum of all outgoing interface costs along the path from source to destination. OSPF uses the SPF (Shortest Path First) algorithm from Dijkstra to find the path with the lowest total cost.

What is the auto-cost reference-bandwidth command?

The auto-cost reference-bandwidth OSPF subcommand changes the reference bandwidth used for auto-cost calculation. Cisco recommends setting this to a value high enough to distinguish between all link speeds in your network, such as 1000 Mbps for Gigabit or 10000 Mbps for 10 GE links.

What is the maximum OSPF cost?

The OSPF cost field is 16 bits, so the maximum cost value is 65,535. If the calculated cost exceeds this, the interface will not be advertised in OSPF. This is rarely an issue with default settings, but can occur with very low-bandwidth links when using a high reference bandwidth.

Does OSPF cost affect routing on all vendors the same way?

The OSPF cost standard (RFC 2328) is consistent across vendors, but the default reference bandwidth and interface bandwidth values may differ. For example, Cisco defaults to 100 Mbps reference, while some vendors use different defaults. Always verify and align configuration across multi-vendor networks.