LOGBOOK

HELP

1 / 6
Other keys: showSpace: good1-4: rate0: skip5: flag6: invert

Question

When a router receives a packet, what are the three possible outcomes based on the routing table lookup?

Answer

The router either: (1) forwards via a matching static route to the next-hop/exit interface, (2) forwards via the default static route if no specific match exists, or (3) drops the packet and sends ICMP (Internet Control Message Protocol) Destination Unreachable if no route matches at all.

Specific match, else default route, else drop + ICMP unreachable.

* The three routing-table lookup outcomes. *

The three forwarding decisions, step by step:

Outcome 1 — Specific route match found:

  • Destination IP (Internet Protocol) matches a static (or dynamic) route entry
  • Router identifies the next-hop IP address or exit interface from the route
  • Packet is encapsulated in a new Layer 2 frame and forwarded

Outcome 2 — No specific match, but default route exists:

  • No route specifically matches the destination IP
  • Router falls back to the default static route (0.0.0.0/0 or ::/0)
  • Packet is forwarded to the default gateway (typically the ISP (Internet Service Provider))
  • This is why the default route is called the "gateway of last resort"

Outcome 3 — No match at all, no default route:

  • No route matches AND no default route is configured
  • Packet is dropped
  • Router sends ICMP (Internet Control Message Protocol) Destination Unreachable (Type 3) back to the source
  • The source sees "Destination host unreachable" or "No route to host"

Note — the "packet for me" case: these three outcomes all concern transit traffic that the router has to forward. Before the routing-table lookup even happens, the router checks whether the destination IP is one of its own interface addresses (e.g. a ping to the router, an SSH/management session, or a routing-protocol update). If so, the packet is consumed locally — handed up the stack to the router itself — and never enters the forwarding path at all.

Tip: If users report "destination unreachable" errors, first check: does the router have a route to the destination? If not — is a default route configured? These two checks resolve most routing problems.

Go deeper:

or press any other key