Cost
Cheat sheet · https://pcornel.dk/topic.php?topic=1094
Answer
OSPF cost is the metric for each interface, added up along a path; the lowest total cost wins. On Cisco the default is reference bandwidth (100 Mbps) divided by interface bandwidth, so set auto-cost reference-bandwidth higher on networks faster than 100 Mbps.
Remember
Do not infer service health from one command. For Cost, distinguish configured intent, protocol/security state, installed forwarding state and the original workload result.
First checks
show ip ospf interface <interface>— Costshow ip route ospf— total metricshow running-config | section router ospf— auto-cost reference-bandwidth
Commands
ip ospf cost <n>show ip route <prefix>show ip ospf interface briefip ospf cost
Verify in this order
interface bandwidth/ref → cost → SPF sums costs → best path
Where it usually breaks
underlay/interface reachability → protocol adjacency/session → received/originated state → policy → best path/RIB → FIB/adjacency → traffic path
Cost operational reference
| Boundary | Known-good for Cost | Suspicious signature | Next proof |
|---|---|---|---|
| Intent | Matches the per-interface OSPF metric whose cumulative path value drives intra-domain shortest-path selection design | Configuration differs from design/peer | Compare effective configuration |
| Control/security state | Stable expected neighbor/database/binding/election state | asymmetric or unexpected path selection from inconsistent reference bandwidth, explicit cost left on one interface, equal costs where differentiation was intended, or metric tuning used to mask an adjacency/forwarding fault | Inspect protocol/security detail and adjacent state |
| Forwarding | Expected Layer-2 or RIB/FIB/gateway path | Control state exists but traffic path disagrees | MAC/ARP/RIB/FIB/CEF proof |
| Closure | Original test passes for explained reason | Symptom moved, was bypassed or protection disabled | Regression test |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=1094