Refer to the following excerpt from a Cisco router's IPv4 routing table:
text
Gateway of last resort is 192.168.4.1 to network 0.0.0.0
S 10.1.4.0/24 [1/0] via 192.168.1.1
O 10.1.4.64/27 [110/20] via 192.168.2.1, 00:12:45, GigabitEthernet0/0/2
D 10.1.0.0/16 [90/307200] via 192.168.3.1, 01:45:10, GigabitEthernet0/0/3
S* 0.0.0.0/0 [1/0] via 192.168.4.1
The router receives an IP packet destined for . Which next-hop IP address will the router select to forward this packet?
- 192.168.2.1Answer
- B192.168.1.1
- C192.168.3.1
- D192.168.4.1
Answer
The router forwards the packet to next-hop IP address 192.168.2.1.
The destination IPv4 address matches multiple routes in the routing table: , , , and . Router forwarding decision logic dictates that the router will ALWAYS prefer the Longest Prefix Match (most specific subnet mask). Comparing mask lengths (/27 > /24 > /16 > /0), the route has the longest match. Therefore, the router forwards the packet to next-hop .
Step-by-Step Solution
Key Concept
Router Forwarding Decision Logic (Longest Prefix Match)