An enterprise router displays the following output from the `show ip route` command:
text
Gateway of last resort is not set
172.20.0.0/16 is subnetted, 4 subnets
S 172.20.0.0/16 [1/0] via 10.10.10.1
O 172.20.8.0/21 [110/65] via 10.10.20.1, 00:08:12, GigabitEthernet0/0/1
D 172.20.12.0/23 [90/2578560] via 10.10.30.1, 00:22:45, GigabitEthernet0/0/2
O 172.20.13.0/25 [110/110] via 10.10.40.1, 00:03:50, GigabitEthernet0/0/3
The router receives a packet with a destination IPv4 address of . Based on the routing table components and forwarding logic, which next-hop IP address and outbound interface will the router select to forward this packet?
- 10.10.40.1 via GigabitEthernet0/0/3Answer
- B10.10.10.1 via the static route next-hop
- C10.10.30.1 via GigabitEthernet0/0/2
- D10.10.20.1 via GigabitEthernet0/0/1
Answer
Next-hop 10.10.40.1 via GigabitEthernet0/0/3
When a router receives an IP packet, it evaluates all matching prefix entries in its routing table and selects the entry with the longest prefix length (most specific mask). The destination address 172.20.13.45 falls within the range of 172.20.13.0/25 (172.20.13.0 to 172.20.13.127), which has a /25 prefix length. Because /25 is longer and more specific than /23, /21, or /16, the router forwards the packet to next-hop 10.10.40.1 out interface GigabitEthernet0/0/3 regardless of Administrative Distance.
Step-by-Step Solution
Key Concept
Longest Prefix Match (LPM) resolution in Cisco routing tables