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.
OSPF (Open Shortest Path First) · Routing Table
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.
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
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
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
| Symptom | Command | Look for | Next check |
|---|---|---|---|
| Route missing | show ip ospf database | The LSA that carries the prefix | Missing LSA: originating router, area or filtering. LSA present: SPF or next-hop issue |
| Route present as another protocol | show ip route <prefix> | Known via and AD | A lower-AD source (static, EIGRP) wins |
| E2 chosen over expected path | show ip route <prefix> | Route type and metric | E2 ignores internal cost; consider E1 or adjusted seed metrics |
| Neighbor issue | show ip ospf neighbor | FULL (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 · 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.
show ip route ospf— O, O IA, O E1/E2 routesshow 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:
| Code | Meaning | Preferred |
|---|---|---|
O | Intra-area | 1 (best) |
O IA | Inter-area (via an ABR, Type 3 LSA) | 2 |
O E1 / O N1 | External type 1: external cost plus internal cost to the ASBR | 3 |
O E2 / O N2 | External 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.
| Code | Meaning |
|---|---|
| O | Intra-area route (Type 1 and 2 LSAs) |
| O IA | Inter-area route (Type 3 summary LSAs) |
| O E1 / O E2 | External route redistributed into OSPF; E2 by default |
| O N1 / O N2 | NSSA 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
| Order | Route type |
|---|---|
| 1 | Intra-area (O) |
| 2 | Inter-area (O IA) |
| 3 | External type 1 (E1, N1) |
| 4 | External 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)
| Point | Detail |
|---|---|
| Static default | Not propagated by OSPF; use default-information originate |
| Conditional default | default-information originate route-map |
| Summarisation | area 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.
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.
| Code | Meaning | Preference order |
|---|---|---|
| O | Intra-area | 1 |
| O IA | Inter-area | 2 |
| O E1 / N1 | External, metric includes internal cost | 3 |
| O E2 / N2 | External, 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].
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
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
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%Quick lookup tables
OSPF operational reference
Topic-specific bounded interpretation: known-good state, suspicious signatures and the next technical proof boundary.
| Check | Known-good | Failure signature | Next boundary |
|---|---|---|---|
| Neighbor | Required adjacencies Full | Missing/unstable adjacency | OSPF neighbor |
| LSDB | Prefix/topology represented | LSA absent/wrong | Origination/area |
| OSPF candidate | SPF produces route | No candidate | SPF/policy |
| RIB | OSPF wins when intended | Other source selected | AD/selection |
| FIB | Next hop resolved | Unresolved/drop | Adjacency |