A Cisco router receives an IPv4 packet destined for . The router inspects its routing table and finds the following matching route entries:
text
S 10.25.0.0/16 [1/0] via 172.16.1.1
O 10.25.8.0/23 [110/30] via 172.16.2.1
D 10.25.8.0/27 [90/2170112] via 172.16.3.1
S* 0.0.0.0/0 [1/0] via 172.16.0.1
Which next-hop IP address will the router choose to forward this packet?
- 172.16.3.1Answer
- B172.16.1.1
- C172.16.2.1
- D172.16.0.1
Answer
The router will forward the packet to next-hop 172.16.3.1 based on the longest prefix match rule.
The destination IP address 10.25.8.12 falls within the subnet range of 10.25.8.0/27 (10.25.8.0 to 10.25.8.31). Because /27 has the largest prefix length among all matching routes (/27 > /23 > /16 > /0), the router uses this route and forwards the packet to 172.16.3.1.
Step-by-Step Solution
Key Concept
Longest Prefix Match (LPM) Rule