Lesson 40: OSPF Cost and Optimization
OSPF Cost
OSPF uses Cost as its metric. The default calculation is:
$$\text{Cost} = \frac{10^8 \text{ (Reference Bandwidth in bps)}}{\text{Interface Bandwidth in bps}}$$
- Default Reference Bandwidth is 100 Mbps, meaning Gigabit Ethernet links (1000 Mbps) also get a cost of 1, leading to suboptimal routing.
Adjusting Reference Bandwidth:
ios Router(config-router)# auto-cost reference-bandwidth 1000
(This sets the reference to 1000 Mbps, ensuring 1 Gbps links have a cost of 1 and 10 Gbps links have a cost of 0.1, rounded up to 1. Use 10000 for 10G links.)
Passive Interfaces
Interfaces connected to end-user segments (LANs) do not need to form OSPF adjacencies. Keeping OSPF disabled on these interfaces improves security and reduces processing overhead.
ios Router(config-router)# passive-interface GigabitEthernet 0/1
Note: The network connected to a passive interface is still advertised in OSPF.