AP Networking • Routing • Practice

Routing Table Practice Questions: Longest Prefix, Default Routes, and Next Hops

Learn to solve routing-table questions mechanically: identify every matching route, choose the longest prefix, evaluate the selected next hop or connected interface, then verify whether the return path allows the conversation to succeed.

Independent AP Networking resource • Updated 2026-09-14 • Includes 24 free digital flashcards
Routing rule: match destination first, choose the most specific prefix second, then evaluate whether that selected route can actually forward.
Practice with Flashcards
Core method

Separate route selection from successful forwarding

A routing table question has two different layers of reasoning. First, the router decides which route entry best matches the destination. Second, the router must actually be able to use that selected route—through a reachable next hop or directly connected interface. Students often mix these steps together and lose points.

Decision chain: Destination IP → Matching prefixes → Longest prefix → Selected route → Next-hop/interface usability → Return path → End-to-end result.
Five-step lookup

Use this order every time

1. Read destinationIgnore source and next-hop addresses at first.
2. Find matchesList every route containing that destination.
3. Choose longestHighest prefix length wins.
4. Follow routeUse connected interface or resolve next hop.
5. Verify returnCheck whether replies can get back.
Longest prefix

The most specific matching route wins

Routing table: 0.0.0.0/0 via A 10.0.0.0/8 via B 10.20.0.0/16 via C Destination: 10.20.4.5

All three entries match 10.20.4.5, but the /16 is the most specific because it fixes more leading bits of the destination. Therefore the /16 route via C wins.

Exam trap: do not choose the default route just because it appears first or seems like the “Internet route.” Default is only used when no more-specific route matches.
Scenario 1

/24 beats /16, /8, and /0

C 192.168.10.0/24 directly connected S 10.0.0.0/8 via 192.168.10.2 S 10.20.0.0/16 via 192.168.10.3 S 10.20.30.0/24 via 192.168.10.4 S* 0.0.0.0/0 via 192.168.10.1 Destination: 10.20.30.55

Best answer: use 10.20.30.0/24 via 192.168.10.4.

Why: the destination matches /8, /16, /24, and /0, but /24 is the longest matching prefix.

Scenario 2

Change only the destination and the winning route changes

DestinationMatching routesWinnerReason
10.20.30.55/8, /16, /24, /010.20.30.0/24Most specific match
10.20.99.5/8, /16, /010.20.0.0/16/24 no longer contains destination
10.99.1.1/8, /010.0.0.0/8/16 and /24 do not match
203.0.113.8/0 only0.0.0.0/0No more-specific route exists

Swipe horizontally to compare the route decisions.

Connected route

Directly connected destinations do not need a remote router next hop

C 192.168.5.0/24 is directly connected Destination: 192.168.5.90

The router recognizes the destination as being on a directly attached subnet. It forwards toward the connected interface and resolves the destination's local-link address as needed.

What this proves: route selection does not require a remote next-hop router. What remains: local-link delivery can still fail because of ARP/neighbor resolution, VLAN, interface, or host problems.
Default route

Default is a fallback, not a preferred shortcut

A default route such as 0.0.0.0/0 matches every IPv4 destination because it fixes zero network bits. That makes it the least specific possible match.

Route: 0.0.0.0/0 via 192.168.1.1 Destination: 203.0.113.8 No specific route exists: Use default.

If a /8, /16, /24, or any other more-specific matching route appears later, that more-specific route wins.

Next-hop reachability

A selected route can still be unusable

Selected route: 10.20.30.0/24 via 192.168.10.4 Connected network: 192.168.10.0/24 Observed: ARP/neighbor resolution for 192.168.10.4 fails

The routing lookup is correct: the /24 route wins. But forwarding still fails because the router cannot reach the selected next hop on the connected network.

Key distinction: “Which route wins?” and “Can that route forward successfully?” are separate questions.
Recursive lookup

A next hop may require another routing decision

Some routes specify a next-hop IP that is not directly connected. The router may need to look up how to reach that next hop before it can forward the original packet. This is often called recursive resolution.

Route to destination: 172.16.0.0/16 via 10.1.1.9 Route to next hop: 10.1.1.0/24 directly connected Result: Forward out the interface for 10.1.1.0/24 toward next hop 10.1.1.9
Return path

One correct forward lookup does not guarantee a working conversation

Forward router: 192.168.10.0/24 → 10.20.30.0/24 works ✓ Destination-side router: No route back to 192.168.10.0/24 ✕ Observed: Request leaves client Reply never returns

End-to-end communication depends on both directions. The forward route can be perfect while the reverse path is missing, filtered, or misrouted.

Same prefix length

Longest-prefix matching happens before route preference comparisons

If two candidate routes have different prefix lengths, the longer prefix wins regardless of metric or route source. If two routes describe the same prefix length, the router may compare administrative preference, protocol preference, metric, or other implementation-specific rules.

RoutesFirst decisionThen
10.0.0.0/8 and 10.20.0.0/16/16 wins by prefix lengthNo metric comparison needed between these two
Two routes to 10.20.0.0/16Same prefix lengthPreference/metric may decide

Swipe horizontally to see the route-selection distinction.

Scenario 3

Do not choose the “closest-looking” next-hop address

10.0.0.0/8 via 192.168.10.2 10.20.0.0/16 via 192.168.10.250 Destination: 10.20.4.5

The /16 route wins even though 192.168.10.2 might look numerically “closer” or simpler. Next-hop addresses do not compete by numeric closeness. Route selection is based on destination prefix matching.

★ Routing Practice • Routing Table Practice Questions: Longest Prefix, Default Routes, and Next Hops

A five-minute warm-up for Routing Table Practice Questions: Longest Prefix, Default Routes, and Next Hops

Tomorrow’s opening question can pick up where this page leaves off: have students trace the connection and explain why traffic takes that path. The 300 Bell Ringers give you short questions and teacher answers you can use without preparing a new starter each morning.

300 AP Networking Bell Ringers
$74.99
BUY TEACHER PACK → See what is included in the 300 Bell Ringers →
Instant Access • Full-Year Teacher Resource
Scenario 4

A more-specific route can intentionally override a broad route

10.0.0.0/8 via Core-A 10.20.30.0/24 via Firewall-B Destination: 10.20.30.55

The /24 route can intentionally steer only that subnet through Firewall-B while the rest of 10.0.0.0/8 follows Core-A. This is a practical reason longest-prefix matching exists: broad routes provide scale while specific exceptions override them.

Black-hole pattern

A specific route can be more specific—and still be wrong operationally

Suppose 10.20.30.0/24 points to a dead next hop while 10.0.0.0/8 points to a healthy path. The router still selects the /24 because it is more specific. It does not “fall back” to /8 merely because the /24's path is broken unless the routing implementation removes or invalidates that specific route.

Routing Lab • 120 Missions

Let students try Routing Table Practice Questions: Longest Prefix, Default Routes, and Next Hops for themselves

Reading the explanation is a start. In the browser simulator, students work through a broken network, choose what to test and see whether their fix worked. It gives them another chance to use what they learned about Routing Table Practice Questions: Longest Prefix, Default Routes, and Next Hops.

AP Networking Browser Troubleshooting Simulator
$29.99
120 Missions • 60 Failure Patterns • Offline Copy
GET THE SIMULATOR → See all 120 missions & features
Exam trap: longest-prefix matching does not mean “choose the most specific working route after trying each one.” The forwarding table contains the active routes the router believes it should use.
Host route

A /32 is the most specific IPv4 route possible

10.20.30.0/24 via A 10.20.30.55/32 via B Destination: 10.20.30.55 Winner: 10.20.30.55/32 via B

A host route can override a subnet route for exactly one destination. This is an excellent changed-fact drill because only one address receives different treatment.

Null/discard route

Some selected routes intentionally drop traffic

A routing table can contain a discard or null route used for summarization, loop prevention, or policy. If that route is the longest match, the packet may be intentionally dropped rather than forwarded to a next hop.

Routing Exam Practice • Routing Table Practice Questions

Check whether Routing Table Practice Questions: Longest Prefix, Default Routes, and Next Hops has really stuck

Once students have worked through this topic, give them questions mixed in with the rest of the course. The Exam Prep Vault includes practice exams, multiple-choice questions and artifact labs so they cannot rely on a chapter heading to tell them what to do.

AP Networking Complete Exam Prep Vault
$39.99
GET THE EXAM PREP VAULT → See the Exam Prep Vault contents →
4 Practice Exams • 320 MCQs • 60 Artifact Labs
Evidence lesson: “The route matches” does not always mean “the packet is forwarded to another router.” The selected route's action matters.
Binary reasoning

Prefix length is really a statement about matching leading bits

A /24 compares the first 24 bits of the destination with the route's network bits. A /16 compares only the first 16. Because /24 fixes more bits, it describes a smaller, more-specific destination set.

10.20.30.0/24 10.20.30.55 First 24 bits match: route applies 10.20.0.0/16 10.20.30.55 First 16 bits also match: route applies Longest match: 24 bits > 16 bits
Failure signatures

Use the artifact pattern to decide what to test next

ObservationLikely boundaryBest next artifact
No matching route except defaultRouting design / fallback behaviorRouting table and intended topology
Correct route selected, next hop unreachableLocal-link/next-hop reachabilityARP/neighbor table, interface/VLAN state
Forward path works, replies missingReturn path / policyRemote routing table, firewall logs
Wrong route winsMore-specific route presentPrefix lengths and active routes
Two equal-prefix routes differPreference/metric selectionRoute source, preference, metric

Swipe horizontally to see the troubleshooting matrix.

Premium Routing Feedback

Spend less time marking explanations about Routing Table Practice Questions: Longest Prefix, Default Routes, and Next Hops

When students explain their answer, it takes more than a right-or-wrong check to see what they understand. The Grading Copilot helps you review how they used the clues, where their explanation falls short and what feedback to give next. You make the final grading decision.

AP Networking Artifact Analysis Grading Copilot
$49.99
8 Criteria • 5 Task Modes • Offline Premium Copy
GET THE GRADING COPILOT → See the free Copilot preview
Distractor analysis

Common wrong answers sound plausible because they skip one decision step

Changed-fact drills

Change one fact and force the answer to change

Drill A

Original: destination 10.20.30.55 → /24 wins. Change destination to 10.20.99.5. New answer: /16 wins.

Drill B

Original: only default matches 203.0.113.8. Add 203.0.113.0/24. New answer: /24 wins.

Drill C

Original: 192.168.5.90 is directly connected. Change interface network to 192.168.6.0/24. New answer: connected route no longer applies.

Drill D

Original: /24 next hop unreachable. Change ARP/neighbor state so next hop resolves. New answer: forwarding failure must be investigated farther downstream.

Worked packet walk

Follow one packet from lookup to frame creation

Packet destination: 10.20.30.55 Routing lookup: 10.20.30.0/24 via 192.168.10.4 Next-hop network: 192.168.10.0/24 connected Neighbor resolution: 192.168.10.4 → aa:bb:cc:dd:ee:ff Forwarding action: IP destination remains 10.20.30.55 Ethernet destination becomes aa:bb:cc:dd:ee:ff

This connects Layer 3 route selection with Layer 2 local delivery. The route tells the router where to send the packet next; ARP/neighbor resolution supplies the local frame destination.

What this proves / does not prove

Keep routing evidence within its boundary

EvidenceSupportsStill unproven
Route table contains 10.20.30.0/24Router has an active route entryNext hop is reachable
Longest match is /24That route wins lookupPacket reaches final destination
Next hop ARPs successfullyLocal delivery to next hop worksRemote routing works
Forward ping reaches destinationSome bidirectional IP reachability exists for ICMPApplication port/service works
TCP session succeedsTransport path and listener workApplication logic is correct

Swipe horizontally to see the evidence boundaries.

NEW • COMPLETE 180-DAY TEACHER CURRICULUM

Teach Routing Table Practice Questions: Longest Prefix, Default Routes, and Next Hops as part of a planned school year

This page gives you one topic. The 180-Day Teacher Curriculum puts it into a full course plan, with daily teaching notes, student activities and checks for understanding. Use it when you need to know what comes before this lesson and what to teach next.

AP Networking Complete 180-Day Teacher Curriculum
$199.99
180 Lessons • 180 Daily Simulators • 36 Teaching Weeks
GET THE 180-DAY CURRICULUM → See 3 free curriculum examples
AP explanation pattern

Write the answer in four sentences

1. Matching routes: The destination matches /8, /16, /24, and /0. 2. Selection: The /24 is the longest matching prefix, so it wins. 3. Forwarding boundary: The selected route points to next hop 192.168.10.4. 4. Verification: Confirm that the next hop is reachable and that a return route exists.

This format gives both the routing decision and the evidence boundary, which is much stronger than writing only “use the /24.”

Capstone

Solve the full table, then break one dependency

C 192.168.10.0/24 directly connected S 10.0.0.0/8 via 192.168.10.2 S 10.20.0.0/16 via 192.168.10.3 S 10.20.30.0/24 via 192.168.10.4 S 10.20.30.55/32 via 192.168.10.5 S* 0.0.0.0/0 via 192.168.10.1

Determine the selected route for 10.20.30.55, 10.20.30.90, 10.20.99.8, 10.88.1.1, and 203.0.113.8. Then make 192.168.10.5 unreachable and explain why route selection and successful forwarding are now different conclusions.

Free digital flashcards

24 routing-table digital flashcards

Practice longest-prefix matching, defaults, connected routes, next hops, recursive lookups, return paths, evidence boundaries, and distractor rejection.

All routing cards
Click or press Enter/Space to reveal.
Match first, then evaluate forwarding.
0 seen•24 cards
Continue studying

Move from route selection into complete packet-path analysis