Refer to the following partial IPv4 routing table output from a Cisco router:
text
Gateway of last resort is 192.168.1.1 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 192.168.1.1, 5d12h, GigabitEthernet0/0/0
S 10.200.0.0/16 [1/0] via 192.168.14.2, 3d02h, GigabitEthernet0/0/3
D 10.200.45.0/24 [90/307200] via 192.168.13.2, 00:15:30, GigabitEthernet0/0/2
O 10.200.45.64/29 [110/20] via 192.168.12.2, 00:04:12, GigabitEthernet0/0/1
The router receives a packet with a destination IP address of . Which next-hop IP address and outbound interface will the router select to forward this packet?
- 192.168.12.2 via GigabitEthernet0/0/1Answer
- B192.168.14.2 via GigabitEthernet0/0/3
- C192.168.13.2 via GigabitEthernet0/0/2
- D192.168.1.1 via GigabitEthernet0/0/0
Answer
The router forwards the packet to next-hop IP 192.168.12.2 via GigabitEthernet0/0/1.
When a router receives a packet, it compares the destination IP against all entries in its IP routing table and selects the match with the longest subnet mask (Longest Prefix Match). The subnet 10.200.45.64/29 covers IP addresses 10.200.45.64 through 10.200.45.71, which includes host 10.200.45.68. Because /29 is more specific than /24, /16, or /0, the router chooses next-hop 192.168.12.2 via GigabitEthernet0/0/1.
Step-by-Step Solution
Key Concept
Longest Prefix Match Rule in Cisco IPv4 Forwarding Logic