A layer 3 switch on a multi-site network receives a frame carrying an IP packet addressed to host . The switch's Routing Information Base (RIB) contains four active candidate route entries matching the destination address:
| Prefix | Protocol Source | Administrative Distance | Metric | Next-Hop Interface |
|---|---|---|---|---|
| Static | 1 | 0 | GigabitEthernet0/1 | |
| OSPF | 110 | 45 | GigabitEthernet0/2 | |
| RIPv2 | 120 | 2 | GigabitEthernet0/3 | |
| EIGRP | 90 | 1560 | GigabitEthernet0/4 |
Which next-hop interface will the layer 3 switch select to forward this packet?
- GigabitEthernet0/4, because the EIGRP entry provides the longest prefix match for the destination address.Answer
- BGigabitEthernet0/1, because the static route entry possesses the lowest administrative distance value.
- CGigabitEthernet0/3, because the RIPv2 path has the lowest numerical metric value.
- DGigabitEthernet0/2, because OSPF link-state announcements automatically supersede distance-vector protocol entries.
Answer
GigabitEthernet0/4 is selected because the route provides the longest subnet mask match for destination address .
When a router or layer 3 switch forwards a packet, it compares the packet's destination IP address against all entries in its routing table. The primary criteria for path selection is Longest Prefix Match (LPM)—the route with the highest number of matching network bits (most specific subnet mask). Here, covers through , which includes . Because is more specific than , , or , the switch forwards the packet out GigabitEthernet0/4 immediately.
Step-by-Step Solution
Key Concept
Longest Prefix Match (LPM) Path Selection Hierarchy
Estimated Time:1m 30s