Pcornel
Networking

Routing

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

Back to the Topic

Answer

Routing is how a router decides where to send each packet: it looks up the destination in its routing table, picks the most specific matching route, and forwards out of that route's interface towards its next hop.

Remember

The router needs a route to the destination and the destination's router needs a route back — check both directions. Most specific prefix first, then administrative distance, then metric. A route is useful only if its next hop is reachable.

First checks

  • show ip route <dst> — the route used for a destination.
  • show ip route — the whole table, with the source code of each route.
  • show ip cef <dst> — the forwarding entry actually used.
  • show ip protocols — routing protocols running and what they advertise.
  • traceroute <dst> source <interface> — the hops traffic takes.

Commands

show ip route <destination>
Find the longest matching installed prefix, its source, next hop and interface. Use the matching VRF/address-family syn…
show ip cef <prefix> detail
Compare local forwarding with the selected route and resolved next hop. This does not prove hardware forwarding or deli…
show ip protocols
Inspect active IPv4 routing processes and their advertised networks, filters and routing sources.
show ip route <addr>
show ip cef <destination>

Verify in this order

destination address → longest matching prefix → best source by administrative distance → lowest metric → next hop reachable → CEF entry → packet forwarded → return route on the far side

Where it usually breaks

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

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

Confirmation

Confirm action

Continue?