An edge router receives route advertisements from multiple sources for destination networks overlapping with the target IP address . The router's routing table currently contains the following active operational entries:
| Protocol Source | Destination Prefix | Administrative Distance | Metric | Next-Hop Interface |
|---|---|---|---|---|
| EIGRP (Internal) | 90 | 156160 | GigabitEthernet0/0 | |
| OSPF | 110 | 20 | GigabitEthernet0/1 | |
| eBGP | 20 | 100 | GigabitEthernet0/2 | |
| Static Route | 120 | 0 | GigabitEthernet0/3 |
When the router processes an inbound IP packet addressed to , which next-hop interface will be selected to forward the packet?
- GigabitEthernet0/2, because longest prefix matching takes precedence over administrative distance during forwarding decisions.Answer
- BGigabitEthernet0/0, because EIGRP has a lower administrative distance (90) than OSPF (110) and Static routes (120).
- CGigabitEthernet0/1, because OSPF matches the standard /24 classful network boundary with a lower metric than eBGP.
- DGigabitEthernet0/3, because static routes override dynamic dynamic routing protocols for packet forwarding.
Answer
The router forwards the packet out interface GigabitEthernet0/2 because the eBGP route 172.16.10.32/27 has the longest matching prefix (/27) for the target IP address 172.16.10.45.
When a router receives a packet, it searches its routing table for all entries that match the destination IP address. If multiple matching routes exist with different prefix lengths, the router strictly enforces the Longest Prefix Match (LPM) rule. In this scenario, the target IP matches , , and . The subnet mask is the most specific match (27 bits), making GigabitEthernet0/2 the correct forwarding interface regardless of administrative distance or protocol metric.
Step-by-Step Solution
Key Concept
Longest Prefix Match (LPM) in Layer 3 Packet Forwarding