Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

Prefix · Routing Table

Direct answer

A prefix is a network written as address and length — 10.20.0.0/16. It is what the routing table stores and what the router matches destinations against.

When to use this

Use it to read routes correctly and to see which addresses a route covers.

First 30 seconds

1. show ip route <dst> — which prefix matched, from which source?

2. More specific than expected → longer-prefixes on the expected block: who injects it?

3. Less specific than expected (summary or default) → the specific route is missing.

4. show ip cef <dst> — does forwarding agree?

5. Fix the source of the unwanted or missing route, not the metric.

Operational verification

destination address → all routes that contain it → the longest prefix selected → its next hop resolved → CEF entry matches

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Cisco IOS / IOS XE
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.

PlatformCisco IOS / IOS XE · Cisco IOS XE · IOS/IOS XE
Scope / prerequisiteUse it to read routes correctly and to see which addresses a route covers.
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.

4 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 Operational verification and known-good state Verify boundary

For a concrete incident, use the actual destination IP and correct VRF. Inspect all relevant matches and identify the longest prefix that should win. Confirm that route’s source, next hop, outgoing interface and age/state, then follow recursion until a directly resolvable adjacency is reached. Compare with FIB/CEF to ensure the data plane installed the expected result. If ECMP exists, note all installed next hops and the flow hash/member context. When a summary, default or leaked route is involved, verify the more-specific route’s presence in the exact table rather than assuming protocol adjacency means route installation. Record administrative distance and metric only after confirming prefix length, because preference values compare candidates for the same prefix and cannot override a longer, valid match.

Step 2 Failure signatures and troubleshooting branches Narrow the fault

If traffic takes an unexpected path, first check for a more-specific prefix rather than changing protocol metrics. If the expected prefix is absent, investigate advertisement, policy/filtering, VRF import/export or static/connected state. If the RIB selects the expected route but CEF is unresolved or points to drop adjacency, troubleshoot recursion, ARP/ND and interface state. If only some flows fail under ECMP, correlate the selected next hop/member. If forward routing is correct but a stateful session fails, trace the return prefix independently; route symmetry is not guaranteed. Avoid clearing entire routing processes when one prefix/policy boundary can be inspected directly.

Step 3 When the problem is really fixed Narrow the fault

After remediation, the same destination and VRF must select the intended longest-match prefix, resolve to the expected FIB/adjacency and carry the original traffic successfully. Verify the return path and one adjacent prefix or route class so a policy change did not unintentionally alter broader reachability. A routing-table entry is control-plane state; a CEF entry is local forwarding state. Neither alone shows remote delivery, firewall/NAT acceptance or application success. Keep those truth boundaries explicit in any later Evidence record. If the repair changed route policy, summarization, redistribution or leaking, inspect a representative adjacent prefix and the less-specific fallback as regression boundaries. Re-run the lookup after protocol convergence and confirm the route does not disappear or switch owner unexpectedly; transient installation is not durable closure.

Step 4 Common mistakes Narrow the fault
  • Reading prefix length incorrectly.
  • Overlapping prefixes without intent.
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

The length says how many leading bits must match. A shorter prefix covers more addresses. Two routes with the same address but different lengths are different routes.

Key checks
  • show ip route <dst> — the route actually chosen for that address.
  • show ip route <prefix> <mask> longer-prefixes — every more specific route under a block.
  • show ip cef <dst> — the forwarding entry used.
  • show ipv6 route <dst> — the same for IPv6.
ReferenceHow it works1 section · depth on demand

Quick reference

A prefix in the routing table is the destination network plus its prefix length (e.g. 10.20.0.0/24). The router keeps different prefix lengths as separate entries, and for each packet uses the longest prefix that matches the destination address.

EntryMatches 10.20.0.15?Used?
0.0.0.0/0YesOnly if nothing longer
10.0.0.0/8YesIf no /24
10.20.0.0/24YesYes — longest
show ip route longer-prefixes 10.20.0.0 255.255.0.0

Documented example, not captured output.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Prefix: the network part of a route

Each routing table entry is keyed by a prefix: a network address plus the number of leading bits that identify the network. RFC 1812, in its CIDR discussion, states that routers must use the most specific matching route, the longest matching network prefix, when forwarding, so the prefix (and its length) decides which route a packet uses.

Prefix notation

PrefixNetwork bitsAddresses covered
10.0.0.0/8810.0.0.0–10.255.255.255
10.20.0.0/161610.20.0.0–10.20.255.255
10.20.30.0/242410.20.30.0–10.20.30.255
10.20.30.4/303010.20.30.4–10.20.30.7
10.20.30.5/3232One host
0.0.0.0/00Everything (default route)

Prefix versus address

ConceptExample
Interface address10.20.30.5/30 (a host in the subnet)
Prefix in the routing table10.20.30.4/30 (the network)
Host route10.20.30.5/32 (the L route for the router's own address)
R1# show ip route 10.20.30.0 255.255.255.0 longer-prefixes
      10.0.0.0/8 is variably subnetted, 12 subnets, 4 masks
O        10.20.30.0/24 [110/3] via 10.0.12.2, 00:12:01, GigabitEthernet0/0/1
C        10.20.30.4/30 is directly connected, GigabitEthernet0/0/4
L        10.20.30.5/32 is directly connected, GigabitEthernet0/0/4
R1# show ip route supernets-only

The longer-prefixes option lists every route inside 10.20.30.0/24, including more specific ones.

Why prefixes must be correct

MistakeResult
Wrong mask on a static routeRoute covers too much or too little
Host bits set in a configured prefixIOS normalises it, which may hide a typo
Overlapping prefixes from different sitesTraffic follows the most specific one

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.

Mechanics and state ownership

Routing and forwarding involve two related selections. First, routing protocols/static/connected sources compete to install route information for destination prefixes in the RIB; preference rules such as administrative distance and protocol metric resolve candidates for the same prefix. Then packet forwarding applies longest-prefix match across the installed prefixes for the destination address, so a /24 beats a /16 and default /0 only wins when nothing more specific matches. The selected route may recursively point through another prefix to resolve a next hop, after which the FIB/CEF programs a usable adjacency/interface. A route line in the RIB therefore does not by itself show that forwarding recursion succeeded or that the reverse table contains a compatible path.

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 docCisco IOS / IOS XE Current documentation reviewed 2026-09-14

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

Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%
Embedded reference data

Quick lookup tables

Prefix operational reference

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

Prefix/routing checkKnown-goodFailure signatureNext boundary
Matching prefixesIntended most-specific route existsUnexpected more-specific/default onlyRoute source/policy
RIB winnerCorrect source/next hop for prefixRoute absent or different next hopProtocol/static/VRF logic
RecursionResolves to reachable next hopRecursive/unresolved chainSupporting prefix + ARP/ND
FIB/CEFExpected adjacency/interfaceDrop/punt/wrong memberData-plane programming
Return prefixCompatible reverse path existsMissing/asymmetric stateful pathRemote routing/policy
Confirmation

Confirm action

Continue?