CCNP-Studies
Routing
2-OSPF
Ospf Path Preference

OSPF Path Preference

  1. Specificity Matters: In OSPF, the most specific route always takes precedence, especially when summarization is involved. Even when multiple routes to the same prefix have equal costs, routers prioritize the more specific route. For example, if there are two routes to 10.30.50.0/24, and one is summarized to 10.30.0.0/16, the non-summarized route (10.30.50.0/24) is preferred in the Routing Information Base (RIB).

  2. Route Type Priority:

    • OSPF follows a specific order when considering route types before evaluating Administrative Distance (AD) or Metric values:
      1. O: Internal routes
      2. O-IA: Inter-area routes (summaries)
      3. E1: Preferred due to increasing metric at each hop within the network
      4. E2: The default in Cisco
      5. N1: Preferred due to increasing metric at each hop within the network
      6. N2: The default in Cisco
  3. Metric and AD:

    • OSPF path preference factors in metrics and Administrative Distances (AD):
      • Metrics consider factors such as bandwidth (BW), with cost derived from bandwidth. You can adjust interface costs using ip ospf cost <1-65535>.
      • Links above 100 Mbps share the default reference bandwidth of 100 Mbps unless changed with auto-cost reference-bandwidth <1-4294967> (in Mbits per second).
      • In Intra-area routes, cost is the sum of exit interface costs to the destination.
      • In Inter-area and external routes, cost reflects the advertised cost to the Area Border Router (ABR), not to the advertising router. The total cost includes ABR's cost and the cost to reach the ABR based on hops.
      • You can modify route preference by adjusting Administrative Distance (AD) using distance <1-255>.
      • For other route types, use distance ospf with the route type and desired AD value (e.g., distance ospf external <1-255>) to change AD.