A router has these routes in its routing table:
O 172.16.0.0/16 O 172.16.20.0/24 S 172.16.20.128/25
A packet destined for 172.16.20.200 arrives. Which route will the router use?
O 172.16.0.0/16 O 172.16.20.0/24 S 172.16.20.128/25
A router has these routes in its routing table:
O 172.16.0.0/16 O 172.16.20.0/24 S 172.16.20.128/25
A packet destined for 172.16.20.200 arrives. Which route will the router use?
Answer choices
Good practice is not just finding the correct option. The wrong answers often show the exact trap the exam wants you to fall into.
172.16.0.0/16
The /16 route matches, but it is less specific than the /25.
172.16.20.0/24
The /24 route also matches, but the /25 is more specific.
172.16.20.128/25
Correct. Longest prefix match takes precedence over route source and less specific entries.
The default route
A default route is only used when no more specific route matches.
Common exam trap
A frequent exam trap is to select the route with the lowest administrative distance or the route learned via OSPF simply because it is dynamic. Candidates often overlook that the router first applies the longest prefix match rule before considering administrative distance. In this question, the static route 172.16.20.128/25 is more specific than the OSPF routes, so it is chosen despite static routes typically having a lower administrative distance. Misunderstanding this can lead to incorrect answers, especially when multiple routes overlap in the routing table.
Technical deep dive
Routing tables store multiple routes to the same destination network, each with different subnet masks and administrative distances. The core concept in routing is the longest prefix match, where the router selects the route with the most specific subnet mask that matches the destination IP address. This ensures packets are forwarded along the most precise path available. When a packet arrives, the router compares the destination IP against all routes in its routing table. It chooses the route with the longest subnet mask that includes the destination IP, regardless of whether the route is learned via OSPF (denoted by 'O') or configured statically (denoted by 'S'). In this question, the static route 172.16.20.128/25 is the most specific match for 172.16.20.200, so it is selected over the broader OSPF routes. A common exam trap is to assume that dynamic routing protocols like OSPF always take precedence over static routes or that the route with the lowest administrative distance is always chosen first. However, the longest prefix match rule supersedes administrative distance when multiple routes match the destination. Practically, this means network engineers must carefully design subnetting and route entries to ensure traffic follows the intended path.
Related practice questions
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Practise IPv4 subnetting, CIDR, masks, host ranges and subnet selection.
Practise OSPF neighbours, router IDs, metrics, areas and routing-table interpretation.
Practise VLANs, access ports, trunks, allowed VLANs and switching scenarios.
Practise spanning tree, root bridge election, port roles and STP troubleshooting.
Practise LACP, PAgP, port-channel behaviour and bundle requirements.
Practise standard and extended ACLs, permit/deny logic and traffic filtering.
Practise static NAT, dynamic NAT, PAT and inside/outside address translation.
Practise DHCP scopes, relay, leases and troubleshooting.
Practise routing-table output, longest-prefix match, AD and route selection.
Practise trunk verification and VLAN forwarding across switches.
Practise WLAN security, authentication and wireless architecture concepts.
Practise IPv6 addressing, routes, neighbour discovery and common IPv6 exam traps.
Keep practising from the same exam bank, or move into a focused topic page if this question exposed a weak area.
Question 1
Question 2
Question 3
Question 4
Question 5
Question 6
FAQ
A router selects the route with the longest prefix match when multiple routes match a destination IP address.
The correct answer is: 172.16.20.128/25 — Routers choose the most specific matching route. The destination 172.16.20.200 falls within 172.16.20.128/25, so that static route is used even though broader matches also exist.
Then try more questions from the same exam bank and focus on understanding why the wrong options are tempting.
Sign in to join the discussion.