Pcornel
Networking · Routing › Routing Table

Prefix

Cheat sheet · https://pcornel.dk/topic.php?topic=1062

Back to the Topic

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.

Remember

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.

First 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.

Verify in this order

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

Where it usually breaks

underlay/interface reachability → protocol adjacency/session → received/originated state → policy → best path/RIB → FIB/adjacency → traffic path

Prefix operational reference

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

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=1062

Confirmation

Confirm action

Continue?