Network Troubleshooting

A router's table holds 10.1.0.0/16 via 192.168.1.2, 10.1.5.0/24 via 192.168.1.3 and 0.0.0.0/0 via 192.168.1.1. Where does it forward a packet for 10.1.5.20?

Show the answer

Correct answerC. 192.168.1.3

AWhy not this: The /16 also matches, but a shorter prefix loses to a more specific route.

BWhy not this: The default route is used only when no more specific route matches.

CWhy this is right: The /24 is the longest matching prefix for 10.1.5.20, so this next hop wins.

DWhy not this: A matching route exists, so the router forwards the packet instead of dropping it.

A router picks the matching route with the longest prefix. The /24 is the most specific match for 10.1.5.20, so the packet goes to 192.168.1.3. The /16 also matches, but it is less specific and is not used.