A library router holds an OSPF route for 10.40.0.0/16 and a static route for 10.40.8.0/24 toward the branch firewall. Which route forwards a packet destined for 10.40.8.20?
Select an answer to reveal the explanation.
Short Explanation
Routing is picky about the street address before it cares who told it the directions. You have a neighborhood route and a single-block route, and the packet is aimed at a house on that block, so the longer prefix wins. The trap is assuming a dynamic protocol, or a better metric, gets to jump the line.
Full Explanation
IP forwarding selects the route with the longest matching prefix before it compares how the routes were learned. Both the OSPF 10.40.0.0/16 and the static 10.40.8.0/24 contain 10.40.8.20, but /24 is more specific than /16, so the static route is the one installed for that destination. Administrative distance matters only when two candidate routes have the same prefix length and come from different sources. A metric matters only inside a single routing protocol. Neither comparison is reached here, so the claim that OSPF outranks static routing, and the claim that a lower OSPF metric beats the static route, both skip the first test. The default route is used when no other route matches. It is not a fallback for prefixes that are merely shorter than a host route, and a host route is not required for a packet to match a network route. Exam caveat: if the static route were for a different, non-overlapping prefix, OSPF would carry 10.40.8.20. Overlap is what makes prefix length decisive. Operational check: inspect the routing table for 10.40.8.20 and confirm the chosen entry is the /24 via the branch firewall, then repeat the lookup for an address such as 10.40.9.20 and confirm that one follows the /16.