200-301 Question 300
Single answerA router needs to forward a packet destined for the IP address 192.168.1.66. The routing table contains the following entries:
- 192.168.1.0/24 via GigabitEthernet0/0
- 192.168.1.64/27 via GigabitEthernet0/1
- 192.168.0.0/16 via GigabitEthernet0/2
- 0.0.0.0/0 via GigabitEthernet0/3
Which interface will the router use to forward the packet?
- A
GigabitEthernet0/0
- B
GigabitEthernet0/1
- C
GigabitEthernet0/2
- D
GigabitEthernet0/3
Show answer and explanation
Correct answer: B
Explanation
Longest prefix match is a key concept in routing where the router selects the route with the most specific prefix length (largest number of bits) that matches the destination IP. In this scenario, the destination IP 192.168.1.66 matches multiple routes, but the route 192.168.1.64/27 has the longest prefix length of 27 bits, making it the best match. Therefore, the packet will be forwarded via GigabitEthernet0/1.
- A. Incorrect.
This route (192.168.1.0/24) matches the destination IP, but its prefix length (24) is shorter than the prefix length of 192.168.1.64/27. Therefore, this is not the best match.
- B. Correct.
This route (192.168.1.64/27) matches the destination IP and has the longest prefix length (27 bits) among all matching routes. Hence, it is the best match.
- C. Incorrect.
This route (192.168.0.0/16) matches the destination IP, but its prefix length (16) is shorter than the prefix length of both 192.168.1.0/24 and 192.168.1.64/27. Therefore, this is not the best match.
- D. Incorrect.
This is the default route (0.0.0.0/0), which is used only when no other routes match the destination. Since there are more specific routes available, the default route will not be used.