Question

Difficulty: MediumRouter Forwarding Decision Logic

Refer to the following routing table snippet from a Cisco router:

text
Codes: C - connected, S - static, O - OSPF, D - EIGRP

Gateway of last resort is not set

O 10.50.16.0/20 [110/50] via 192.168.1.1, 00:04:12, GigabitEthernet0/0
D 10.50.24.0/22 [90/307200] via 192.168.2.2, 00:12:45, GigabitEthernet0/1
S 10.50.25.0/24 [1/0] via 192.168.3.3
O 10.50.25.128/26 [110/30] via 192.168.4.4, 00:01:10, GigabitEthernet0/2

A packet arriving at the router is destined for host address 10.50.25.14010.50.25.140. Which two statements accurately describe how the router processes and forwards this packet? (Select TWO.)

  1. The router selects the route entry 10.50.25.128/26 because /26 represents the longest matching prefix for the destination address.Answer
  2. The packet will be forwarded out of interface GigabitEthernet0/2 toward next-hop IP 192.168.4.4.Answer
  3. C
    The router selects the static route 10.50.25.0/24 because static routes have a lower administrative distance (1) than OSPF (110).
  4. D
    The router selects the EIGRP route 10.50.24.0/22 because EIGRP has a lower metric than OSPF.

Answer

The router selects the route entry for 10.50.25.128/26 because /26 is the longest prefix match for destination IP 10.50.25.140, and consequently forwards the packet out of interface GigabitEthernet0/2 to next-hop 192.168.4.4.
When a router receives an IP packet, it compares the destination IP address against all routing table entries and selects the route with the most specific subnet mask (longest prefix match). Address 10.50.25.14010.50.25.140 matches 10.50.25.128/2610.50.25.128/26 (range 10.50.25.12810.50.25.128 to 10.50.25.19110.50.25.191). Because /26/26 is longer than /24/24, /22/22, and /20/20, the router chooses this route and forwards the traffic via interface GigabitEthernet0/2 to next-hop 192.168.4.4192.168.4.4.

Step-by-Step Solution

1
Determine which routing table entries match the destination IP address 10.50.25.140.
All four routes match the destination: 10.50.16.0/20, 10.50.24.0/22, 10.50.25.0/24, and 10.50.25.128/26.
10.50.25.140 falls within the address range of each of these four subnet prefixes.
2
Apply the Longest Prefix Match (LPM) rule to select the best route.
The route 10.50.25.128/26 is chosen because its prefix length (/26) is the most specific.
Prefix length always takes priority over Administrative Distance and routing metrics during route lookup.
3
Identify the forwarding exit interface and next-hop address associated with the winning route.
Next-hop: 192.168.4.4, Exit interface: GigabitEthernet0/2.
The routing table entry specifies these forwarding parameters for 10.50.25.128/26.

Key Concept

Router Forwarding Decision Logic (Longest Prefix Match)
Rate this question