Refer to the following Cisco CLI routing table output:
text
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
Gateway of last resort is not set
S 172.31.50.0/24 [1/0] via 10.1.1.1, GigabitEthernet0/0/1
D 172.31.50.64/28 [90/307200] via 10.2.2.2, GigabitEthernet0/0/2
O 172.31.50.64/29 [110/20] via 10.3.3.3, GigabitEthernet0/0/3
R 172.31.50.68/30 [120/1] via 10.4.4.4, GigabitEthernet0/0/4
A router receives an IP packet addressed to . Which next-hop IP address will the router select to forward this packet?
- 10.3.3.3Answer
- B10.1.1.1
- C10.2.2.2
- D10.4.4.4
Answer
The router forwards the packet to next-hop IP address 10.3.3.3 via interface GigabitEthernet0/0/3.
The correct choice identifies 10.3.3.3 as the next hop because the route 172.31.50.64/29 has the longest matching prefix (/29) among all valid candidate routes covering destination IP 172.31.50.67. A router always prefers the most specific route (longest prefix length) regardless of Administrative Distance or metric.
Step-by-Step Solution
Key Concept
Longest Prefix Match (LPM) Logic