Refer to the following partial IPv4 routing table output from a Cisco router:
text
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 4 subnets, 4 masks
O 172.16.10.0/24 [110/20] via 192.168.1.1, 00:05:12, GigabitEthernet0/0
D 172.16.10.0/25 [90/307200] via 192.168.1.2, 00:12:44, GigabitEthernet0/1
S 172.16.10.128/26 [1/0] via 192.168.1.3, 01:15:00, GigabitEthernet0/2
C 172.16.10.128/30 is directly connected, GigabitEthernet0/3
The router receives a packet destined for IP address 172.16.10.130. Which interface or next-hop IP address will the router select to forward this packet?
- GigabitEthernet0/3Answer
- B192.168.1.3 via GigabitEthernet0/2
- C192.168.1.2 via GigabitEthernet0/1
- D192.168.1.1 via GigabitEthernet0/0
Answer
The router will forward the packet out interface GigabitEthernet0/3 because the directly connected route 172.16.10.128/30 provides the longest prefix match for destination 172.16.10.130.
The destination host 172.16.10.130 matches three entries in the routing table: 172.16.10.0/24, 172.16.10.128/26, and 172.16.10.128/30. According to Cisco router forwarding logic, the router evaluates Longest Prefix Match (LPM) first. Because /30 has 30 matching network bits, it is the most specific route and will be used to forward the packet out GigabitEthernet0/3.
Step-by-Step Solution
Key Concept
Longest Prefix Match (LPM) is the fundamental rule routers use to select a route from the routing table when forwarding a packet. The router selects the route with the highest number of matching network bits (longest prefix length), regardless of administrative distance.
Estimated Time:1m 30s