Question

Difficulty: MediumRouter Forwarding Decision Logic

Refer to the following partial IPv4 routing table output from a Cisco router:

text
Gateway of last resort is 192.168.1.1 to network 0.0.0.0

S* 0.0.0.0/0 [1/0] via 192.168.1.1
O 172.16.0.0/16 [110/50] via 10.1.1.1, 01:14:22, GigabitEthernet0/0/1
D 172.16.35.0/24 [90/2172416] via 10.2.2.2, 00:42:10, GigabitEthernet0/0/2
S 172.16.35.32/27 [1/0] via 10.3.3.3
O 172.16.35.40/29 [110/30] via 10.4.4.4, 00:08:15, GigabitEthernet0/0/3

A packet with a destination IP address of 172.16.35.42172.16.35.42 arrives at the router. Which two statements correctly describe how the router makes its forwarding decision for this packet? (Select two.)

  1. The router forwards the packet to next-hop 10.4.4.4 because 172.16.35.40/29 provides the longest matching prefix for the destination address.Answer
  2. B
    The router forwards the packet to next-hop 10.3.3.3 because static routes take precedence over OSPF routes regardless of subnet prefix length.
  3. Administrative distance is evaluated only after the router identifies all candidate routes that share the longest matching prefix length.Answer
  4. D
    The router drops the packet because 172.16.35.42 is the direct broadcast address for the 172.16.35.40/29 subnet.

Answer

The router forwards the packet to next-hop 10.4.4.4 because 172.16.35.40/29 is the longest matching prefix, and administrative distance is evaluated only after determining candidate routes with the longest matching prefix length.
When a router receives a packet, it compares the destination IP against all entries in its routing table and selects the entry with the longest prefix match (most specific mask). Here, 172.16.35.40/29 matches 29 bits of the destination address 172.16.35.42, making it more specific than the /27 static route or /24 EIGRP route. Administrative distance is only evaluated when choosing among routes with identical prefix lengths.

Step-by-Step Solution

1
Evaluate all routes matching the destination IP address 172.16.35.42.
Matching routes: 0.0.0.0/0 (/0), 172.16.0.0/16 (/16), 172.16.35.0/24 (/24), 172.16.35.32/27 (/27), and 172.16.35.40/29 (/29).
The destination address 172.16.35.42 resides within the IP range 172.16.35.40 to 172.16.35.47 defined by the /29 subnet mask.
2
Apply the Longest Prefix Match (LPM) rule.
The route 172.16.35.40/29 has a 29-bit mask, which is longer than /27, /24, /16, or /0.
Routers always prefer the route with the most specific (longest) subnet mask first, before considering administrative distance or metric.
3
Verify if 172.16.35.42 is a valid unicast host IP in 172.16.35.40/29.
Subnet ID: 172.16.35.40, Usable hosts: 172.16.35.41 - 172.16.35.46, Broadcast: 172.16.35.47.
172.16.35.42 is a valid host address, so the packet is forwarded to next-hop 10.4.4.4 via GigabitEthernet0/0/3.

Key Concept

Longest Prefix Match (LPM) Rule in Cisco IPv4 Forwarding Logic
Estimated Time:1m 30s
Rate this question