A router learns 172.16.0.0/16 from OSPF and 172.16.10.0/24 from a static route. Which route is used for traffic to 172.16.10.55?
The static /24 route is correct because the destination 172.16.10.55 matches its prefix length of 24 bits (172.16.10.0/24), whereas the OSPF /16 route only matches the first 16 bits. Routers use longest prefix match (LPM) to select the most specific route, and the /24 is more specific than both the /16 and any default route. Even though OSPF may have a lower administrative distance, prefix length takes precedence over AD for route selection when prefixes differ, so the static /24 is installed in the forwarding table for this destination.
Why this answer
The static /24 route is used because it is more specific than the OSPF /16 route. In plain language, even though OSPF is a dynamic source and the /16 covers the destination broadly, the router prefers the entry that describes the exact destination range more precisely. Since 172.16.10.55 falls within 172.16.10.0/24, that route wins under longest-prefix match.
This is a classic example of route specificity taking priority before broader route-source comparisons would matter between equal prefix lengths.
Exam trap
A frequent exam trap is assuming that the dynamic OSPF route will always be preferred over a static route, regardless of prefix length. Many candidates overlook that the router prioritizes the longest-prefix match before considering administrative distance or route source. Because 172.16.10.0/24 is more specific than 172.16.0.0/16, the router uses the static route for traffic to 172.16.10.55.
Misunderstanding this can lead to incorrect answers, especially when both routes overlap. Remember, overlapping routes are common and resolved by prefix specificity, not by route type alone.
Why the other options are wrong
The OSPF /16 route is less specific than the static /24 route. Although OSPF is a dynamic routing protocol, the router prefers the route with the longer prefix length, so this option is incorrect.
The default route is only used when no specific matching route exists. Since both OSPF and static routes cover the destination, the default route is not used here, so this option is incorrect.
Overlapping prefixes are normal in routing tables and do not prevent route selection. The router resolves overlaps using longest-prefix match, so this option is incorrect.
When would these options actually be correct?
In a different scenario where the static route is removed or not configured, the OSPF /16 route would be the only available route for traffic to 172.16.10.55. Thus, the OSPF route would be the correct answer in that case.
In a different question where the router has no specific routes for the destination IP address and only a default route configured, traffic to an unknown destination would use the default route. For example, if the question stated that the router only had a default route and no other specific routes for 172.16.10.55, then the default route would be correct.
In a scenario where a question states that both routes are configured but the static route is incorrectly defined as 172.16.0.0/24 instead of /16, the option D would be correct, as both routes would overlap and cause ambiguity in routing decisions.
Why candidates pick the wrong answer
Students may think OSPF is preferred over static routes due to lower administrative distance, but they forget that longest-prefix match is evaluated first. The /16 route covers the destination but is not the most specific match.
Students might think that if a route is learned via OSPF and a static route exists, the router might fall back to a default route. However, the presence of any matching route (even a static one) prevents the default route from being used.
Some students may incorrectly believe that overlapping prefixes cause a routing loop or error, but routers handle overlapping routes by choosing the most specific match. This is a fundamental concept in IP routing.