1.10 Troubleshoot OSPF (v2/v3)
📘CCNP Enterprise – ENARSI (300-410)
1. What is Path Preference in OSPF?
- Path Preference is how OSPF decides which route to use when multiple paths exist to the same destination.
- OSPF always selects the best path based on cost, but there are other rules as well.
Key point for the exam:
OSPF always prefers the path with the lowest total cost to a destination.
2. How OSPF Determines the Best Path
OSPF uses several factors to decide which path is preferred:
a) Cost
- OSPF assigns a cost value to each interface.
- Cost is usually based on interface bandwidth:
Cost = Reference Bandwidth / Interface Bandwidth
- Default reference bandwidth: 100 Mbps (Cisco default)
- Example:
- FastEthernet (100 Mbps) → Cost = 1
- GigabitEthernet (1 Gbps) → Cost = 1 (if reference bandwidth updated to 1 Gbps)
- Lower cost = more preferred path.
b) OSPF Route Types
If two routes exist with same cost, OSPF prefers based on LSA type:
- Intra-area (O) → Highest preference
- Inter-area (O IA) → Next
- External Type 1 (O E1) → Next
- External Type 2 (O E2) → Last
Exam tip: Intra-area routes are always preferred over inter-area, even if inter-area has lower cost.
c) Equal-Cost Multipath (ECMP)
- If multiple paths exist with exactly the same cost, OSPF can use all paths simultaneously.
- Cisco supports up to 16 equal-cost paths by default.
- This is load balancing at Layer 3, not just a backup path.
3. Administrative Distance
- Administrative Distance (AD) determines preference between different routing protocols, not within OSPF itself.
- OSPF default AD: 110.
- Example: If OSPF and EIGRP both know a route, the lower AD route is preferred.
- Internal OSPF paths (O, O IA) have the same AD, so OSPF uses cost-based selection.
4. OSPF External Routes
- OSPF can receive routes from other routing protocols or redistribute static routes.
- External routes have two types:
- E1 → Cost includes internal OSPF cost + external cost
- E2 → Cost uses only the external metric (default)
- E1 is preferred over E2 if two external routes to the same network exist.
Exam tip:
Remember: OSPF prefers paths in this order: Intra-area → Inter-area → E1 → E2.
5. How Path Preference Affects Routing
- OSPF path preference ensures traffic always uses the most efficient route.
- If a better path appears (lower cost), OSPF will recalculate the routing table and prefer the new path.
- If multiple equal-cost paths exist, OSPF load-balances traffic automatically.
6. Verification Commands
To check path preference and route selection:
- Show OSPF routes in the routing table
show ip route ospf
O→ Intra-areaO IA→ Inter-areaO E1 / O E2→ External
- Check OSPF cost to a destination
show ip ospf database
- Look at LSAs and the advertised cost.
- Check OSPF neighbor states
show ip ospf neighbor
- Ensures neighbor relationships are stable, which affects path availability.
7. Summary Table for Exam
| Factor | How it affects preference |
|---|---|
| Cost | Lower cost = preferred path |
| Route type | O > O IA > O E1 > O E2 |
| ECMP | Equal-cost paths can be used simultaneously (up to 16) |
| Administrative Distance | Only matters when comparing different protocols |
| External routes | E1 preferred over E2 if both exist |
✅ Exam Tip:
When a question asks “which OSPF path will be used?”:
- Check intra-area vs inter-area vs external
- Check total cost
- Check if multiple equal-cost paths exist
