Pcornel
Networking · Network & Protocols › OSPF Protocol Reference

OSPF Cost & Path Selection Reference

Cheat sheet · https://pcornel.dk/topic.php?topic=212

Back to the Topic

Answer

OSPF picks the path with the lowest total cost. Each interface's cost is the reference bandwidth divided by the interface bandwidth, and a path's cost is the sum of the outgoing interfaces along it.

Remember

With the default reference of 100 Mb/s, every interface of 100 Mb/s or more has cost 1; raise it with auto-cost reference-bandwidth on all routers alike. Route type is compared before cost: intra-area beats inter-area beats E1 beats E2.

First checks

  • show ip ospf interface brief — the cost of each interface.
  • show ip ospf | include Reference — the reference bandwidth.
  • show ip route <network> — route type, total cost and next hops.
  • show ip ospf border-routers — cost to each ABR and ASBR.

Commands

show ip route
ip ospf cost
show ip ospf
ip ospf cost <n>

Verify in this order

reference bandwidth equal on all routers → interface costs as designed → path cost = sum of outgoing interface costs → route type compared first, then cost → equal costs installed together

Where it usually breaks

underlay/interface reachability → protocol adjacency/session → received/originated state → policy → best path/RIB → FIB/adjacency → traffic path

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=212

Confirmation

Confirm action

Continue?