Use it to explain why a packet left by a particular interface, or why it was dropped.
Forwarding Decision
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.
1. show ip route <dst> — which prefix?
2. show ip cef <dst> — same next hop and interface?
3. Several next hops → show ip cef exact-route <src> <dst> for the flow in question.
4. show ip arp <next hop> — resolved?
5. Incomplete → the next hop is down or in another VLAN.
destination address → longest match in the routing table → CEF entry → next hop → adjacency with MAC address → packet rewritten and sent out of the interface
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 Verification and output interpretation Verify boundary
Start with the exact destination: inspect show ip route <destination>, then show ip cef <destination> to compare selected control-plane route with programmed forwarding state. If CEF resolves through a next hop, inspect the relevant adjacency/ARP state and outgoing interface. For ECMP, verify all expected next hops are present and operational. If a route exists in the RIB but CEF shows unresolved, drop or an unexpected egress, the useful boundary is between route selection and forwarding resolution rather than inside the routing protocol itself.
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.
Subtopics
Go one level deeper into this subject.
Longest prefix match is the forwarding rule that chooses, among all routes containing the destination, the entry with the longest prefix: 10.1.1.0/24 beats 10.1.0.0/16, and 0.0.0.0/0 is used only when nothing more specific matches.
Subtopic Administrative DistanceAD helps choose the source that installs one exact prefix. Destination-based forwarding then uses the longest matching installed prefix; a lower-AD /24 does not override an installed /25.
Subtopic MetricA metric is the cost a routing protocol uses to choose between its own paths to the same prefix (OSPF cost, EIGRP composite metric, RIP hop count).
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.
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.
ReferenceImportant terms & boundaries4 sections · depth on demand
In depth
The forwarding decision
For each packet, a router picks one route and one next hop. RFC 1812's CIDR rule sets the basis: routers must use the most specific matching route, the longest matching prefix. Administrative distance and metrics decide earlier which routes are installed; the per-packet decision then uses longest match, and load-sharing chooses among equal paths.
Steps for each packet
| Step | Decision |
|---|---|
| 1 | Is the destination one of the router's own addresses? → deliver locally |
| 2 | Policy (PBR, VRF) overrides? → use the policy |
| 3 | Longest prefix match in the FIB |
| 4 | Several equal paths? → hash the flow to one |
| 5 | Resolve the next hop's Layer 2 address (adjacency) |
| 6 | Rewrite the frame, decrement TTL, forward |
Example
| Installed route | Length | Match for 10.30.0.15? |
|---|---|---|
| 0.0.0.0/0 | 0 | Yes |
| 10.0.0.0/8 | 8 | Yes |
| 10.30.0.0/16 | 16 | Yes → chosen |
| 10.30.1.0/24 | 24 | No |
R1# show ip cef 10.30.0.15
10.30.0.0/16
nexthop 10.0.12.2 GigabitEthernet0/0/1
nexthop 10.0.13.2 GigabitEthernet0/0/2
R1# show ip cef exact-route 10.110.0.64 10.30.0.15
10.110.0.64 -> 10.30.0.15 =>IP adj out of GigabitEthernet0/0/2, addr 10.0.13.2
R1# show ip route 10.30.0.15 | include Known|via
Known via "ospf 1", distance 110, metric 12, type inter area
* 10.0.12.2, from 10.255.0.2, 00:41:02 ago, via GigabitEthernet0/0/1
10.0.13.2, from 10.255.0.3, 00:41:02 ago, via GigabitEthernet0/0/2
When a packet can't be forwarded
| Situation | Result |
|---|---|
| No matching route and no default | Dropped; ICMP destination unreachable |
| Route to Null0 | Dropped (summary discard route) |
| TTL reaches zero | Dropped; ICMP time exceeded (used by traceroute) |
| Next hop unresolved | Dropped until ARP completes |
Troubleshooting order
Check the route (show ip route), the forwarding entry (show ip cef), the chosen path for the flow (exact-route), then the next hop's ARP entry.
Documented example, not captured output.
Quick reference
A router's forwarding decision for each packet uses the longest prefix match in the FIB. Which routes are in the routing table was decided earlier: administrative distance chooses between sources for the same prefix, and the metric chooses within one protocol.
| Step | Decides |
|---|---|
| 1. Route installation | AD (source trust), then metric |
| 2. Packet lookup | Longest matching prefix wins |
| 3. Load sharing | Equal-cost paths per flow (CEF) |
show ip route 10.20.5.9
show ip cef 10.20.5.9
Documented example, not captured output.
A /24 static route and a /16 OSPF route can both be installed; packets to an address in the /24 always use the static route regardless of AD.
Concept and state model
The forwarding path begins with the destination IP address, not with a routing-protocol preference. CEF performs a longest-prefix lookup in the FIB and obtains a resolved forwarding action: a next hop, an outgoing interface, a load-sharing set or a special disposition such as drop/punt/receive. Recursive routes are flattened through dependency resolution so packet forwarding does not have to repeat full control-plane logic for every packet. Adjacency state supplies the Layer 2 rewrite information needed for a directly reachable next hop. With ECMP, multiple equal-cost adjacencies can be installed and a hash distributes flows so packet order is preserved as much as possible.
Operational boundaries and common misconceptions
A valid FIB entry shows only local forwarding intent. It does not show the next device accepts the packet, the remote route exists, the reverse path works or an application responds. Likewise, successful ARP shows local neighbor resolution but not remote routing. Hardware forwarding counters can add confidence that packets traverse the local dataplane, but they must be scoped to the correct prefix/interface and interpreted alongside drops, ACL/QoS policy and MTU. Keep local control plane, local forwarding plane and downstream network behavior distinct.
ReferenceConfiguration & state1 section · depth on demand
Configuration model and design choices
Most FIB state is derived rather than configured directly. The important operator inputs are the RIB sources, interface/neighbor resolution, policy features such as PBR where deliberately used, and platform forwarding resources. A clean design avoids unnecessary recursion chains and ensures that next-hop reachability is stable inside the correct VRF. When policy-based forwarding is present, document it explicitly because it can make a packet follow a different path than a plain RIB lookup suggests. Do not “fix” a FIB symptom by repeatedly clearing CEF unless the upstream control/adjacency cause is understood.
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 → Forwarding Decision. 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
Forwarding Decision · reference boundaries
Compact technical reference for the most important state and interpretation boundaries.
| State | Canonical question | Evidence |
|---|---|---|
| RIB | Which route won? | show ip route <destination> |
| FIB | What forwarding action is programmed? | show ip cef <destination> |
| Adjacency | Is the directly resolved next hop usable? | show adjacency / ARP |
| Egress | Is the intended interface forwarding cleanly? | interface counters/status |