StudyToCert

All certifications / CCNA / Lessons

Cisco CCNA 200-301 v2.0 · Domain 3: IP routing

Forwarding decisions: longest prefix match first, then administrative distance, then metric

▶ Watch the overview video

Last reviewed October 6, 2026 · Leer en español

Explain it simpler

A router's table can hold several routes that all cover the same destination, some broad and some narrow. For each packet, the router picks the narrowest route that still fits, the most exact match. It is like delivering a parcel: an address that says '42 Elm Street, Apartment 3B' beats 'somewhere on Elm Street', which beats 'somewhere in this city'. Trust (administrative distance) and path cost (metric) are used earlier, only to decide which of two routes to the exact same group of addresses gets written into the table in the first place. Narrowest match first for each packet; trust and cost only for identical entries.

Priya, the network engineer at Bluewater Logistics, has just added a static route for 10.0.0.0/8 to a backup firewall, confident that its administrative distance of 1 makes it the strongest route on the router. Ten minutes later, warehouse scanners in 10.40.2.0/24 are still flowing over the main OSPF path, untouched, while traffic to some forgotten lab subnet suddenly takes the firewall. Her manager asks why the 'most trusted' route is being ignored for the warehouse but used for the lab. Priya stares at the table. Every route is there. So how does the router actually decide which one a given packet uses?

Two different questions get mixed up in routing: which routes get into the routing table, and which of the installed routes a particular packet uses. Administrative distance (AD) and metric answer the first question. Longest prefix match answers the second. Keeping these separate is the key to getting CCNA forwarding questions right, because answer choices are often designed to tempt you into applying the wrong rule at the wrong stage. Think of it as two separate moments: building the table happens in the control plane as routes are learned, and choosing a route happens in the data plane for every packet. If you remember only one sentence from this lesson, make it this: AD and metric fight over identical prefixes, and longest match picks between different prefixes.

Free account

Keep reading for free

Create a free StudyToCert account to read the rest of this lesson: 8 more sections, 6 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.

Sign up free Log in

Study CCNA for free
A week-by-week plan with every lesson, quizzes, checkpoint tests, a practice exam and hands-on labs.
Open the CCNA study plan