200-301 Question 299
Single answerA router receives a packet destined for the IP address 192.168.10.25. The router's routing table contains the following entries:
- 192.168.10.0/24 via GigabitEthernet0/1
- 192.168.10.16/28 via GigabitEthernet0/2
- 192.168.0.0/16 via GigabitEthernet0/3
- 0.0.0.0/0 via GigabitEthernet0/4
Which interface will the router use to forward the packet?
- A
GigabitEthernet0/1
- B
GigabitEthernet0/2
- C
GigabitEthernet0/3
- D
GigabitEthernet0/4
Show answer and explanation
Correct answer: B
Explanation
The longest prefix match principle ensures that the router selects the route with the most specific matching prefix for the destination IP. In this case, the destination IP 192.168.10.25 matches multiple routes, but the route 192.168.10.16/28 (GigabitEthernet0/2) provides the longest prefix match (28 bits) compared to 192.168.10.0/24 (24 bits) and 192.168.0.0/16 (16 bits). Therefore, the router will forward the packet using GigabitEthernet0/2.
- A. Incorrect.
GigabitEthernet0/1 corresponds to the route with a prefix of 192.168.10.0/24, which matches the destination IP but does not provide the longest prefix match.
- B. Correct.
GigabitEthernet0/2 corresponds to the route with a prefix of 192.168.10.16/28, which matches the destination IP and provides the longest prefix match (28 bits).
- C. Incorrect.
GigabitEthernet0/3 corresponds to the route with a prefix of 192.168.0.0/16, which matches the destination IP but does not provide the longest prefix match.
- D. Incorrect.
GigabitEthernet0/4 corresponds to the default route (0.0.0.0/0), which is only used when no other specific match exists in the routing table.