A core router receives a packet destined for IP address 172.16.42.95. The router's IPv4 routing table contains four candidate paths to reach this destination:
text O 172.16.40.0/21 [110/65] via 10.1.1.1, 00:14:22, GigabitEthernet0/0/0 D 172.16.42.0/24 [90/307200] via 10.2.2.2, 01:05:10, GigabitEthernet0/0/1 S 172.16.42.64/26 [1/0] via 10.3.3.3 O 172.16.42.80/28 [110/30] via 10.4.4.4, 00:02:45, GigabitEthernet0/0/2
Which next-hop IP address will the router use to forward the packet?
- 10.4.4.4Answer
- B10.3.3.3
- C10.2.2.2
- D10.1.1.1
Answer
The router will forward the packet to next-hop IP address 10.4.4.4 via GigabitEthernet0/0/2 because it has the longest prefix match (/28) containing the destination address 172.16.42.95.
When a router makes a forwarding decision, it evaluates all routing table entries that match the destination IP address and selects the entry with the longest prefix mask (the most specific route). For destination 172.16.42.95, the route 172.16.42.80/28 has a 28-bit mask, which is more specific than /26, /24, or /21. Therefore, the router forwards the packet to next-hop 10.4.4.4.
Step-by-Step Solution
Key Concept
Longest Prefix Match Rule in Routing Table Lookups