A Cisco router receives an IP packet destined for . Refer to the following routing table output:
text
Codes: C - connected, S - static, D - EIGRP, O - OSPF
Gateway of last resort is 10.1.1.1 to network 0.0.0.0
D 10.20.0.0/14 [90/2172416] via 192.168.1.2, GigabitEthernet0/1
O 10.20.12.0/22 [110/20] via 192.168.1.6, GigabitEthernet0/2
S 10.20.12.0/24 [1/0] via 192.168.1.10, GigabitEthernet0/3
O 10.20.12.128/25 [110/30] via 192.168.1.14, GigabitEthernet0/4
S* 0.0.0.0/0 [1/0] via 10.1.1.1, GigabitEthernet0/0
Which next-hop IP address will the router select to forward this packet?
- 192.168.1.14Answer
- B192.168.1.10
- C192.168.1.6
- D10.1.1.1
Answer
The router forwards the packet to next-hop IP 192.168.1.14 because the route 10.20.12.128/25 has the longest prefix match for destination 10.20.12.150.
When forwarding IP packets, a Cisco router always prioritizes the route with the Longest Prefix Match (most specific subnet mask). The destination address 10.20.12.150 falls within the range 10.20.12.128 to 10.20.12.255 defined by 10.20.12.128/25. Because /25 is more specific than /24, /22, /14, or /0, the router uses this route, which forwards to next-hop 192.168.1.14.
Step-by-Step Solution
Key Concept
Longest Prefix Match (LPM) precedence in IP forwarding decision logic.