Question

Difficulty: Very hardRouting Concepts and Dynamic Routing Protocols

An edge router receives route advertisements from multiple sources for destination networks overlapping with the target IP address 172.16.10.45172.16.10.45. The router's routing table currently contains the following active operational entries:

Protocol SourceDestination PrefixAdministrative DistanceMetricNext-Hop Interface
EIGRP (Internal)172.16.0.0/16172.16.0.0/1690156160GigabitEthernet0/0
OSPF172.16.10.0/24172.16.10.0/2411020GigabitEthernet0/1
eBGP172.16.10.32/27172.16.10.32/2720100GigabitEthernet0/2
Static Route172.16.10.0/24172.16.10.0/241200GigabitEthernet0/3

When the router processes an inbound IP packet addressed to 172.16.10.45172.16.10.45, which next-hop interface will be selected to forward the packet?

  1. GigabitEthernet0/2, because longest prefix matching takes precedence over administrative distance during forwarding decisions.Answer
  2. B
    GigabitEthernet0/0, because EIGRP has a lower administrative distance (90) than OSPF (110) and Static routes (120).
  3. C
    GigabitEthernet0/1, because OSPF matches the standard /24 classful network boundary with a lower metric than eBGP.
  4. D
    GigabitEthernet0/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 172.16.10.45172.16.10.45 matches 172.16.0.0/16172.16.0.0/16, 172.16.10.0/24172.16.10.0/24, and 172.16.10.32/27172.16.10.32/27. The /27/27 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

1
Determine which advertised subnets contain the target IP address 172.16.10.45.
The target address 172.16.10.45 is contained within 172.16.0.0/16, 172.16.10.0/24, and 172.16.10.32/27 (range: 172.16.10.32 - 172.16.10.63).
All three prefix ranges match the target IP destination.
2
Understand the distinction between routing table installation and packet forwarding logic.
Administrative distance (AD) determines which route gets installed in the routing table when identical prefixes exist. Longest Prefix Match (LPM) determines packet forwarding among installed routes.
Multiple routes with different prefix lengths can coexist simultaneously in the routing table.
3
Compare the prefix lengths of all matching installed routes.
Comparing bit mask lengths: /27 (27 bits) > /24 (24 bits) > /16 (16 bits).
Longest Prefix Match requires selecting the route with the highest number of matching network prefix bits.
4
Map the longest matching prefix to its corresponding egress interface.
The /27 prefix route corresponds to interface GigabitEthernet0/2.
GigabitEthernet0/2 is the next-hop interface for 172.16.10.32/27.

Key Concept

Longest Prefix Match (LPM) in Layer 3 Packet Forwarding
Rate this question