Network Implementation

A router has 10.1.0.0/16 learned via OSPF (AD 110) and 10.1.5.0/24 learned via RIP (AD 120). Which route does it use for a packet to 10.1.5.20?

Show the answer

Correct answerA. The RIP /24 route, because the longer prefix is the more specific match

AWhy this is right: the router picks the longest matching prefix, and the /24 is more specific than the /16.

BWhy not this: A shorter prefix is less specific, and the router prefers the more specific match.

CWhy not this: Load balancing needs equal-cost routes to the same prefix, and these have different prefix lengths.

DWhy not this: Administrative distance is only a tiebreaker between sources for the same prefix, so it is not reached here.

Forwarding uses the longest matching prefix first, so the /24 beats the /16 even though RIP has the higher administrative distance. Administrative distance only chooses between routes to the same prefix.