Skip to content
CCNA 200-301 v1.1 reference — IP Connectivity

Route selection and forwarding

How a router installs routes (administrative distance, metric) versus how it forwards packets (longest-prefix match, then next hop).

Objective 3.2v1.1 exam target

Longest-prefix match

The three rules in order

  1. Forwarding decision (packet in hand): longest-prefix match wins — always, regardless of route source.
  2. Installation decision (two sources offer the SAME prefix): lowest administrative distance wins the RIB.
  3. Within one protocol (same prefix, same protocol): lowest metric wins.

Longest-prefix match is the forwarding rule: for a destination, the router picks the most specific route that contains it. A /24 always beats a /16 and a default /0 never wins while anything more specific exists. Route source and AD are irrelevant at this step — the table only contains winning candidates.

Predict the forwarding path
Table
S 10.0.0.0/8 [1/0], O 10.1.0.0/16 [110/20], C 10.1.5.0/24 (Gi0/1)
Packet
to 10.1.5.9
  1. Candidates: /8 (S), /16 (O), /24 (C) — all match 10.1.5.9.
  2. Longest prefix wins → /24 connected route forwards directly out Gi0/1.
  3. The static and OSPF routes never see this packet despite their sources.

AD never entered the picture — the connected /24 is simply the most specific match.

AD and metric

Administrative distance selects between *candidate* routes for the *same* prefix: connected (0) beats static (1) beats OSPF (110). The loser never enters the table — it exists only as a protocol backup. AD never compares a /24 to a /16.

Metric breaks ties inside one routing protocol for the same prefix — OSPF uses interface bandwidth-derived cost, EIGRP a composite, RIP hop count. Metrics across protocols are incomparable.

Why a floating static stays out of the table
Candidates
OSPF 10.2.0.0/24 [110/20], static 10.2.0.0/24 [120/0]
  1. Same prefix → AD decides: 110 < 120 → OSPF installs.
  2. The static (deliberately at 120) sits ready — it installs only when OSPF's route disappears.
  3. This is the floating static pattern: backup by inflated AD.

AD 120 lost to 110 for the identical /24 — by design.

Applied scenarios

Which rule applies when

SituationDecided by
/24 via OSPF vs /16 via static — packet to a host in the /24Longest prefix → the /24 wins
10.0.0.0/24 learned via OSPF and via staticAD → static (1) beats OSPF (110)
10.0.0.0/24 learned twice inside OSPFMetric → lower cost path wins
Only a default route existsLongest prefix → 0.0.0.0/0 matches
Two static routes for the same prefix, different next hopsSame AD → both install; ECMP load-balances

Verifying the decision

  • show ip route <address> shows the actual match the router will use — the single best debug.
  • If the match is a more-specific route than you expected, the table is working correctly — your expectation wasn't.
  • show ip ospf rib / protocol-specific views show the losing candidates that never installed.

Common mistakes

  • Believing lower AD beats a more-specific route — specificity always wins for forwarding.
  • Comparing metrics between OSPF and EIGRP — meaningless cross-protocol.
  • Expecting a default route to win when anything more specific exists — /0 is the last resort only.
  • Thinking ECMP means two ADs — ECMP requires same source, same prefix, same metric.
Traffic takes the 'wrong' path

Observation: Packets to 10.1.5.9 exit via the WAN router instead of the directly-connected LAN.

Hypotheses
  • A more-specific route on the WAN path
  • The connected interface isn't actually connected/up
  • Asymmetric return path confusion
CheckIndicates
show ip route 10.1.5.9Names the actual route and next hop used — ends the guessing.
Interface status of the 'expected' pathA down interface removes its connected route silently.

Correction: Remove the stray more-specific route or restore the connected path.

show ip route selects the intended route and traffic follows it.

On this page

Related resources

Sources

Targets CCNA 200-301 v1.1 objectives. Supplemental blocks are labeled beyond exam scope.

Search guided lessons, transcript chapters, flashcards, CLI drills and cheat sheets

Route selection and forwarding | CCNA Study