Question

Difficulty: MediumRouter Forwarding Decision Logic

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

text
Gateway of last resort is 192.168.100.1 to network 0.0.0.0

S 10.20.0.0/16 [1/0] via 192.168.1.1
D 10.20.30.0/24 [90/307200] via 192.168.23.3, GigabitEthernet0/0/2
O 10.20.30.64/27 [110/20] via 192.168.12.2, GigabitEthernet0/0/1
S* 0.0.0.0/0 [1/0] via 192.168.100.1, GigabitEthernet0/0/0

The router receives a packet with a destination IP address of 10.20.30.77. Which next-hop IP address will the router select to forward this packet?

  1. 192.168.12.2Answer
  2. B
    192.168.1.1
  3. C
    192.168.23.3
  4. D
    192.168.100.1

Answer

192.168.12.2
When a router receives a packet, it compares the destination IP address against the routing table entries and selects the route with the longest prefix match (most specific subnet mask). The destination IP address 10.20.30.77 falls within the subnet range 10.20.30.64 to 10.20.30.95 (/27). Among all matching routes (/16, /24, /27, and /0), /27 has the greatest number of matching network bits, making the next-hop IP address 192.168.12.2 the correct forwarding choice.

Step-by-Step Solution

1
Identify all candidate routes that match the destination IP 10.20.30.77.
The IP address 10.20.30.77 falls into three specific route ranges: 10.20.0.0/16, 10.20.30.0/24, and 10.20.30.64/27 (range 10.20.30.64 to 10.20.30.95), plus the default route 0.0.0.0/0.
Routing decision logic requires evaluating all matching entries in the IPv4 routing table.
2
Apply the Longest Prefix Match (LPM) rule to select the route with the longest subnet mask.
Comparing the subnet mask lengths (/16, /24, and /27), the prefix /27 is the longest (most specific) match.
The router always prioritizes prefix length above Administrative Distance or Metric when choosing between matching routes.
3
Determine the next-hop IP associated with the chosen /27 route.
The route O 10.20.30.64/27 specifies next-hop IP 192.168.12.2 via GigabitEthernet0/0/1.
The forward decision routes the packet out the next hop designated by the winning route.

Key Concept

Longest Prefix Match (LPM) Precedence
Rate this question