Octet

OSPF learns the same prefix as intra-area, inter-area and external. Which wins?

Show the answer

Say this first

OSPF picks by route type first and cost second. Intra-area (O) beats inter-area (O IA), which beats external type 1 (E1 or N1), which beats external type 2 (E2 or N2). Cost only compares routes of the same type. All of them have administrative distance 110, so AD plays no part.

Go deeper

The order

  1. O intra-area
  2. O IA inter-area
  3. O E1 or O N1
  4. O E2 or O N2

An intra-area path with cost 500 beats an inter-area path with cost 10. This surprises people in designs where the same subnet is reachable inside the area over a slow link and through the backbone over fast ones.

Where it bites

  • A backup WAN link placed in the same area as a branch makes the branch prefer the slow link, because the path becomes intra-area. Put the link in the right area or fix the design.
  • Two ABRs summarizing differently produce a mix of more-specific and summary routes. Longest prefix match still applies first in the FIB, before any OSPF preference.

Order of decisions overall

Longest prefix match across all sources, then administrative distance between protocols, then this OSPF route-type order, then cost, then ECMP across equal-cost paths.

Traps

  • Saying the lowest cost always wins in OSPF. Route type is checked before cost.
How did you do?