Refer to the following output from a Cisco router's routing table:
text
Gateway of last resort is not set
192.168.10.0/24 is variably subnetted, 4 subnets, 3 masks
O 192.168.10.0/24 [110/20] via 10.1.1.1, 00:05:12, GigabitEthernet0/0
D 192.168.10.0/26 [90/307200] via 10.1.1.2, 00:12:45, GigabitEthernet0/1
S 192.168.10.0/27 [1/0] via 10.1.1.3
O E2 192.168.10.16/28 [110/20] via 10.1.1.4, 00:01:10, GigabitEthernet0/2
Which next-hop IPv4 address will the router select to forward a packet with a destination IP address of 192.168.10.20?
- 10.1.1.4Answer
- B10.1.1.3
- C10.1.1.2
- D10.1.1.1
Answer
The router will select the next-hop address 10.1.1.4.
When a router receives a packet, it compares the destination IP address against all entries in its routing table and selects the route with the longest matching prefix (most specific subnet mask). In this scenario, the destination address 192.168.10.20 matches 192.168.10.0/24, 192.168.10.0/26, 192.168.10.0/27, and 192.168.10.16/28. The /28 route is the most specific match (28 bits), so the router uses its specified next-hop address, 10.1.1.4.
Step-by-Step Solution
Key Concept
Longest Prefix Match Rule