Forwarding Decision
Cheat sheet · https://pcornel.dk/topic.php?topic=622
Answer
For each packet the router takes the destination address, finds the longest matching prefix, and sends the packet out of that route's interface towards the resolved next hop. In practice this lookup is done in CEF, built from the routing table.
Remember
Order of decision: longest prefix, then administrative distance, then metric. The next hop must resolve to an interface and a MAC address (ARP). If no route matches and there is no default, the packet is dropped and an ICMP unreachable may be sent.
First checks
show ip route <dst>— the prefix chosen.show ip cef <dst>— the next hop and interface CEF uses.show ip cef exact-route <src> <dst>— which of several equal paths a given flow takes.show ip arp <next hop>— the next hop's MAC address.show adjacency <interface> detail— the rewrite information for the next hop.
Commands
show ip routeshow ip cefshow ip route <destination>show ip cef <destination>
Verify in this order
destination address → longest match in the routing table → CEF entry → next hop → adjacency with MAC address → packet rewritten and sent out of the interface
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=622