Refer to the following IPv4 routing table snippet from a Cisco router:
text
Gateway of last resort is 192.168.100.1 to network 0.0.0.0
S 10.20.0.0/16 [1/0] via 192.168.1.1
D 10.20.30.0/24 [90/307200] via 192.168.23.3, GigabitEthernet0/0/2
O 10.20.30.64/27 [110/20] via 192.168.12.2, GigabitEthernet0/0/1
S* 0.0.0.0/0 [1/0] via 192.168.100.1, GigabitEthernet0/0/0
The router receives a packet with a destination IP address of 10.20.30.77. Which next-hop IP address will the router select to forward this packet?
- 192.168.12.2Answer
- B192.168.1.1
- C192.168.23.3
- D192.168.100.1
Answer
192.168.12.2
When a router receives a packet, it compares the destination IP address against the routing table entries and selects the route with the longest prefix match (most specific subnet mask). The destination IP address 10.20.30.77 falls within the subnet range 10.20.30.64 to 10.20.30.95 (/27). Among all matching routes (/16, /24, /27, and /0), /27 has the greatest number of matching network bits, making the next-hop IP address 192.168.12.2 the correct forwarding choice.
Step-by-Step Solution
Key Concept
Longest Prefix Match (LPM) Precedence