Use it to read routes correctly and to see which addresses a route covers.
Prefix · Routing Table
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.
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.
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 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 · 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.
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.
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.
| Entry | Matches 10.20.0.15? | Used? |
|---|---|---|
| 0.0.0.0/0 | Yes | Only if nothing longer |
| 10.0.0.0/8 | Yes | If no /24 |
| 10.20.0.0/24 | Yes | Yes — 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
| Prefix | Network bits | Addresses covered |
|---|---|---|
| 10.0.0.0/8 | 8 | 10.0.0.0–10.255.255.255 |
| 10.20.0.0/16 | 16 | 10.20.0.0–10.20.255.255 |
| 10.20.30.0/24 | 24 | 10.20.30.0–10.20.30.255 |
| 10.20.30.4/30 | 30 | 10.20.30.4–10.20.30.7 |
| 10.20.30.5/32 | 32 | One host |
| 0.0.0.0/0 | 0 | Everything (default route) |
Prefix versus address
| Concept | Example |
|---|---|
| Interface address | 10.20.30.5/30 (a host in the subnet) |
| Prefix in the routing table | 10.20.30.4/30 (the network) |
| Host route | 10.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
| Mistake | Result |
|---|---|
| Wrong mask on a static route | Route covers too much or too little |
| Host bits set in a configured prefix | IOS normalises it, which may hide a typo |
| Overlapping prefixes from different sites | Traffic follows the most specific one |
Documented example, not captured output.
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
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 → 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%Quick lookup tables
Prefix operational reference
Topic-specific bounded interpretation: known-good state, suspicious signatures and the next technical proof boundary.
| Prefix/routing check | Known-good | Failure signature | Next boundary |
|---|---|---|---|
| Matching prefixes | Intended most-specific route exists | Unexpected more-specific/default only | Route source/policy |
| RIB winner | Correct source/next hop for prefix | Route absent or different next hop | Protocol/static/VRF logic |
| Recursion | Resolves to reachable next hop | Recursive/unresolved chain | Supporting prefix + ARP/ND |
| FIB/CEF | Expected adjacency/interface | Drop/punt/wrong member | Data-plane programming |
| Return prefix | Compatible reverse path exists | Missing/asymmetric stateful path | Remote routing/policy |