Path preference

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:

  1. Intra-area (O) → Highest preference
  2. Inter-area (O IA) → Next
  3. External Type 1 (O E1) → Next
  4. 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:
    1. E1 → Cost includes internal OSPF cost + external cost
    2. 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:

  1. Show OSPF routes in the routing table
show ip route ospf
  • O → Intra-area
  • O IA → Inter-area
  • O E1 / O E2 → External
  1. Check OSPF cost to a destination
show ip ospf database
  • Look at LSAs and the advertised cost.
  1. Check OSPF neighbor states
show ip ospf neighbor
  • Ensures neighbor relationships are stable, which affects path availability.

7. Summary Table for Exam

FactorHow it affects preference
CostLower cost = preferred path
Route typeO > O IA > O E1 > O E2
ECMPEqual-cost paths can be used simultaneously (up to 16)
Administrative DistanceOnly matters when comparing different protocols
External routesE1 preferred over E2 if both exist

Exam Tip:
When a question asks “which OSPF path will be used?”:

  1. Check intra-area vs inter-area vs external
  2. Check total cost
  3. Check if multiple equal-cost paths exist
Buy Me a Coffee