Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

Routing & Forwarding

Direct answer

Routing is how a router learns which networks exist and picks the best way to each; forwarding is what it does with every packet — look up the destination and send it out of the right interface.

When to use this

Use this section as the entry point for "why does traffic go that way" and "there is a route, but it does not work".

First 30 seconds

1. show ip route <destination address> — which route matches, from which source, via which next hop?

2. show ip cef <address> — does forwarding agree, with a resolved next hop?

3. Repeat on the next router along the path.

4. Then the reverse: is there a route back to the source on each hop?

5. ping with an explicit source to test both.

Operational verification

route to the destination on every hop → longest match is the intended route → next hop resolves at Layer 2 → CEF agrees → route back to the source on every hop

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common interpretation traps
  • "The route is in the routing table, so traffic gets through." Only on this router, and only in this direction. Check the next router, and the way back.
  • "The route with the lowest administrative distance is used." Only among routes for the same prefix. A more specific route from any source is preferred first.
  • "A lower metric always wins." Metrics are compared within one protocol; between protocols, administrative distance decides.
  • "Ping from the router works, so hosts behind it can reach the destination." The router pings from its outgoing interface's address; the far side may have a route back to that address and not to the hosts' network.
  • "The traffic returns the way it went." Each direction is routed separately; firewalls that track connections break when the two differ.
  • "A default route means everything is reachable." It only means packets are sent somewhere; the next hop still needs a route.
  • "The routing table shows how the packet is forwarded." Forwarding follows CEF and needs a resolved next hop; an unanswered ARP stops the packet although the route is fine.
Platform / version applicability
Cisco IOS / IOS XE
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCisco IOS / IOS XE
Key commandshow ip route 10.20.0.50
Scope / prerequisiteUse this section as the entry point for "why does traffic go that way" and "there is a route, but it does not work".
What next?3 suggested next steps
Child topics (this level)1
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational verification Verify boundary
show ip route 10.20.0.50
show ip cef 10.20.0.50
show ip arp 10.0.12.2
ping 10.20.0.50 source 10.1.1.1
traceroute 10.20.0.50

show ip route <address> shows the single route that matches the destination: its source, distance, metric and next hop. show ip cef shows what forwarding will actually do — the resolved next hop and interface. The ARP entry confirms the next hop is reachable at Layer 2. A ping with an explicit source tests the return path to that source as well; traceroute shows the last router that had a route.

Repeat the route lookup on each router along the path, and remember the reverse direction.

Known-good: every router on the path matches the destination with the intended route and a reachable next hop, and the same holds for the source address in the opposite direction.

Evidence references

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.

observation · 1
Command lookup Jump straight to Cisco syntax
Drill down

Subtopics

Go one level deeper into this subject.

Key points

Each router decides alone, and each direction is routed separately: a conversation needs a route out on every hop and a route back on every hop. Longest prefix match is applied first; administrative distance only chooses between sources of the same prefix.

Key checks
  • show ip route <address> — the one route that matches the destination.
  • show ip cef <address> — the resolved next hop and interface actually used.
  • show ip arp <next hop> — next hop reachable at Layer 2?
  • ping <address> source <own address> — tests the return path to that source.
  • traceroute <address> — the last router with a route.
ReferenceWhat it is1 section · depth on demand

Mental model

Routing is how a router learns which networks exist and decides the best way to each. Forwarding is what it does with every packet: look up the destination and send the packet out of the right interface. The first builds the tables; the second uses them.

ReferenceWhy it matters1 section · depth on demand

Why it matters operationally

Keeping the two apart explains most routing puzzles. A route can be known to a protocol and not installed; installed and not usable because its next hop does not answer; correct in one direction and missing in the other. Each of those is checked in a different table, and "there is a route" only settles the first.

ReferenceHow it works1 section · depth on demand

How it works

Building the routing table.

1. Sources. Routes come from connected interfaces, static configuration and routing protocols.

2. Each protocol picks its best path to a network by its own metric.

3. Between sources, administrative distance decides when two offer the same prefix: connected 0, static 1, eBGP 20, EIGRP 90, OSPF 110, RIP 120, iBGP 200. Lower wins.

4. The winner is installed in the routing table.

Forwarding a packet.

1. Longest prefix match. Of all routes containing the destination, the most specific is used — a /28 before a /24 before the default route — regardless of where the routes came from.

2. Next hop. If the route names an address and not an interface, that address is looked up in turn until a connected network is reached.

3. Layer 2. The router needs the MAC address of the next hop — from ARP or neighbour discovery — to build the frame.

4. The packet's TTL is decreased and it is sent.

On Cisco routers the forwarding tables are prepared in advance by CEF from the routing table and the ARP table, so each packet needs only one lookup.

Each router decides alone. There is no end-to-end path; every hop repeats the lookup with its own table. For a conversation to work, every router on the way out needs a route to the destination and every router on the way back needs a route to the source. The two directions are independent and can take different paths.

Default route. 0.0.0.0/0 matches everything and is used when nothing more specific exists. Without one, packets for unknown destinations are dropped.

ReferenceImportant terms & boundaries1 section · depth on demand

In depth

Routing and forwarding in two planes

Routing decides where packets should go. Forwarding moves each packet there. RFC 1812 sets the forwarding-side rules: route lookup by longest match, a mandatory TTL decrement on every forwarded packet, and ICMP Time Exceeded when the TTL runs out. On Cisco devices the control plane builds the RIB from connected, static and dynamic routes. CEF turns the RIB into a FIB and an adjacency table, so each packet is forwarded without a full routing decision.

Control plane and data plane

PlaneContainsCommands
Control (routing)Routing protocol tables, RIBshow ip route, show ip ospf database, show bgp
Data (forwarding)FIB, adjacencies, hardware tablesshow ip cef, show adjacency, show platform hardware ...

When RIB and FIB disagree

SymptomPossible cause
The route is in the RIB but traffic takes another pathHardware programming issue, PBR, or a VRF lookup
The FIB entry points to drop or gleanNo adjacency: the ARP entry is missing
Traffic is load-balanced unexpectedlyECMP with per-flow hashing; check show ip cef exact-route

Recursive lookups

A static or BGP route whose next hop isn't directly connected needs a second lookup to reach the next hop. CEF resolves this ahead of time. show ip cef <prefix> detail shows the recursion chain and the final outgoing interface.

R1# show ip route 10.20.0.50
Routing entry for 10.20.0.0/16
  Known via "bgp 65010", distance 200, metric 0
  * 10.255.0.4, from 10.255.0.4
R1# show ip cef 10.20.0.50 detail
10.20.0.0/16, epoch 2
  recursive via 10.255.0.4
    nexthop 10.0.12.2 GigabitEthernet0/0/1
R1# show ip cef exact-route 10.110.0.64 10.20.0.50
R1# show ip arp 10.0.12.2
R1# traceroute 10.20.0.50 source 10.110.0.1 numeric

Reading the output

The BGP route's next hop, 10.255.0.4, is reached via 10.0.12.2 on Gi0/0/1. If that IGP path changes, the BGP route's forwarding changes with it, even though the BGP table didn't change.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCisco IOS / IOS XE Current documentation reviewed 2026-09-14

Authoritative/upstream documentation reviewed for bounded claims in Routing & Forwarding. 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%
Confirmation

Confirm action

Continue?