Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

OSPF (Open Shortest Path First) · Routing Table

Direct answer

An OSPF RIB entry proves the router selected an OSPF-derived path for that prefix. Route code, administrative distance, metric, next hop and outgoing interface each describe a different part of that decision.

When to use this

Use it when OSPF neighbors are Full but a route is absent, a different source wins, or the OSPF route is installed yet forwarding still fails.

First 30 seconds

1. OSPF routes have AD 110.

2. O intra-area, O IA inter-area, O E1/E2 external, O N1/N2 NSSA.

3. Intra beats inter beats external regardless of cost.

4. E2 metric does not add internal cost.

5. Compare with expected design.

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Protocol standard + deployed implementation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProtocol standard · IOS/IOS XE
Scope / prerequisiteUse it when OSPF neighbors are Full but a route is absent, a different source wins, or the OSPF route is installed yet …
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

6 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Known-good closure and original test Verify boundary

Layered verification for OSPF: interface/area eligibility → expected neighbor and state transition → expected LSA in correct area/scope → SPF winner → RIB/FIB/CEF adjacency → original traffic → reverse route/regression Close only when the original source, destination, protocol, VRF/VLAN/policy context and return path are tested.

Step 2 Operational verification and known-good state Verify boundary

Freeze one destination prefix. Confirm the relevant OSPF neighbor state and LSDB information, then verify the local SPF/OSPF route candidate exists. Inspect the generic routing table for the exact prefix and list any connected, static or other dynamic competitors. If OSPF wins, follow its next hop recursively into CEF/FIB and ARP/ND. Test the destination and reverse path. For equal-cost paths, verify all installed next hops are usable. A known-good OSPF RIB entry must agree with both control-plane topology and actual forwarding. Treat each command output, counter, packet capture and state display as an observation from its own boundary. Keep the same VLAN, VRF, interface, prefix, flow or control-plane instance throughout the investigation so evidence from different contexts is not accidentally combined. When a change is made, preserve the original failing test, allow the relevant protocol to converge, re-run that same test, and check one adjacent known-good case for regression before closing the issue.

Step 3 Troubleshooting a missing or unexpected OSPF route Narrow the fault
SymptomCommandLook forNext check
Route missingshow ip ospf databaseThe LSA that carries the prefixMissing LSA: originating router, area or filtering. LSA present: SPF or next-hop issue
Route present as another protocolshow ip route <prefix>Known via and ADA lower-AD source (static, EIGRP) wins
E2 chosen over expected pathshow ip route <prefix>Route type and metricE2 ignores internal cost; consider E1 or adjusted seed metrics
Neighbor issueshow ip ospf neighborFULL (or 2WAY between DROTHERs)Area, timers, authentication, MTU
Step 4 Failure signatures and troubleshooting branches Narrow the fault

Full adjacency with no route suggests LSDB/prefix origination, filtering, area/type or RIB competition rather than neighbor establishment. An OSPF route in protocol output but absent from the RIB may lose on administrative distance to a static or another protocol. A RIB-installed OSPF route with unresolved FIB points to next-hop/adjacency problems. Unexpected metric requires OSPF cost/path analysis; changing AD to force OSPF can mask the real design if a more-trusted route source is intentionally present. Treat each command output, counter, packet capture and state display as an observation from its own boundary. Keep the same VLAN, VRF, interface, prefix, flow or control-plane instance throughout the investigation so evidence from different contexts is not accidentally combined. When a change is made, preserve the original failing test, allow the relevant protocol to converge, re-run that same test, and check one adjacent known-good case for regression before closing the issue.

Step 5 When the problem is really fixed Narrow the fault

Re-run the exact prefix lookup and original traffic. Show the expected OSPF candidate is present, wins or loses the RIB for the intended reason, resolves to a usable FIB adjacency and has a valid return path. If policy or cost changed, inspect an adjacent OSPF prefix for regression. Observed route/LSDB output is Evidence only when captured separately; this Topic explains the interpretation chain and does not claim a production SPF run was verified. Closure means the original failure is no longer reproducible for a technically explained reason and a bounded regression check is clean. Authored guidance, expected output and relation metadata are not observed Evidence, human review or verification timestamps; those truth states must only be created by their dedicated workflows when real observations exist. Treat each command output, counter, packet capture and state display as an observation from its own boundary. Keep the same VLAN, VRF, interface, prefix, flow or control-plane instance throughout the investigation so evidence from different contexts is not accidentally combined. When a change is made, preserve the original failing test, allow the relevant protocol to converge, re-run that same test, and check one adjacent known-good case for regression before closing the issue.

Step 6 Common mistakes Narrow the fault
  • Missing O IA routes because of ABR issues.
  • E2 metric not including internal cost.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points

Adjacency → LSDB → SPF result → RIB selection → FIB/adjacency is a chain. Success at one stage does not prove the next.

Key checks
  • show ip route ospf — O, O IA, O E1/E2 routes
  • show ip route <prefix> — [110/cost]
ReferenceHow it works1 section · depth on demand

OSPF routes in the RIB

OSPF installs routes with administrative distance 110. The route code shows how the route was learned:

CodeMeaningPreferred
OIntra-area1 (best)
O IAInter-area (via an ABR, Type 3 LSA)2
O E1 / O N1External type 1: external cost plus internal cost to the ASBR3
O E2 / O N2External type 2: external cost only (default seed 20)4

OSPF compares route type first and cost second. The RIB then compares AD with other sources, and the longest prefix match still decides forwarding.

ReferenceImportant terms & boundaries3 sections · depth on demand

In depth

OSPF routes in the routing table (codes O, O IA, O E1/E2, O N1/N2)

OSPF routes enter the routing table with administrative distance 110, per the IOS XE routing guide's distance table. The code tells you where the route came from inside the OSPF domain.

CodeMeaning
OIntra-area route (Type 1 and 2 LSAs)
O IAInter-area route (Type 3 summary LSAs)
O E1 / O E2External route redistributed into OSPF; E2 by default
O N1 / O N2NSSA external route (Type 7)
R1# show ip route ospf
      10.0.0.0/8 is variably subnetted, 9 subnets, 3 masks
O        10.20.0.0/24 [110/2] via 10.0.12.2, 00:41:02, GigabitEthernet0/0/1
O IA     10.30.0.0/16 [110/12] via 10.0.12.2, 00:41:02, GigabitEthernet0/0/1
O E2     172.16.0.0/16 [110/20] via 10.0.12.2, 00:12:55, GigabitEthernet0/0/1
R1# show ip route 10.30.0.0
Routing entry for 10.30.0.0/16
  Known via "ospf 1", distance 110, metric 12, type inter area

[110/12] is distance 110 and OSPF cost 12.

OSPF route preference within OSPF

OrderRoute type
1Intra-area (O)
2Inter-area (O IA)
3External type 1 (E1, N1)
4External type 2 (E2, N2)

OSPF chooses by route type first and cost second; administrative distance only matters when comparing OSPF with other protocols.

Defaults and summaries (routing guide)

PointDetail
Static defaultNot propagated by OSPF; use default-information originate
Conditional defaultdefault-information originate route-map
Summarisationarea range on ABRs, summary-address on ASBRs

Checks

Missing OSPF routes usually come from missing adjacencies or LSAs, not from the routing table: check show ip ospf neighbor and show ip ospf database before the RIB.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Quick reference

OSPF routes appear in the routing table with codes showing their type: O intra-area, O IA inter-area, O E1/E2 external, O N1/N2 NSSA external. OSPF has administrative distance 110.

CodeMeaningPreference order
OIntra-area1
O IAInter-area2
O E1 / N1External, metric includes internal cost3
O E2 / N2External, fixed metric (default type)4
show ip route ospf
! O IA 10.30.0.0/16 [110/21] via 10.0.0.2, 00:12:44, Gi0/1

Documented example, not captured output.

The value in brackets is [administrative distance/metric].

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Mechanics and state ownership

OSPF learns link-state information from neighbors, builds a link-state database and runs SPF to derive candidate paths. Those candidates then enter the router’s generic RIB selection process, where administrative distance compares OSPF with other route sources and OSPF cost compares paths within the protocol. The resulting routing-table entry identifies the prefix, OSPF route type/code, metric and next-hop/outgoing information. Therefore a Full neighbor only shows adjacency; a matching LSA only shows LSDB knowledge; and an OSPF route absent from the RIB may be losing to another source or failing eligibility. Treat each command output, counter, packet capture and state display as an observation from its own boundary. Keep the same VLAN, VRF, interface, prefix, flow or control-plane instance throughout the investigation so evidence from different contexts is not accidentally combined. When a change is made, preserve the original failing test, allow the relevant protocol to converge, re-run that same test, and check one adjacent known-good case for regression before closing the issue.

ReferenceConfiguration & state1 section · depth on demand

Reading OSPF routes in show ip route

Illustrative output, not captured Evidence:

O     10.1.20.0/24 [110/2] via 10.1.12.2, 00:12:44, GigabitEthernet0/0/1
O IA  10.2.0.0/16 [110/3] via 10.1.12.2, 00:12:44, GigabitEthernet0/0/1
O E2  192.0.2.0/24 [110/20] via 10.1.12.2, 00:05:10, GigabitEthernet0/0/1

[110/2] is AD/cost; via is the next hop and the outgoing interface; the time is the route's age.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docProtocol standard + deployed implementation RFC 2328

Authoritative/upstream documentation reviewed for bounded claims in Routing → Routing Table → OSPF. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc2328.html · confidence 94%
Embedded reference data

Quick lookup tables

OSPF operational reference

Topic-specific bounded interpretation: known-good state, suspicious signatures and the next technical proof boundary.

CheckKnown-goodFailure signatureNext boundary
NeighborRequired adjacencies FullMissing/unstable adjacencyOSPF neighbor
LSDBPrefix/topology representedLSA absent/wrongOrigination/area
OSPF candidateSPF produces routeNo candidateSPF/policy
RIBOSPF wins when intendedOther source selectedAD/selection
FIBNext hop resolvedUnresolved/dropAdjacency
Confirmation

Confirm action

Continue?