Question

Difficulty: MediumRouting Table Components

A Cisco router receives an IPv4 packet destined for host 192.168.4.66. The routing table contains the following entries:

text
Gateway of last resort is not set

192.168.4.0/24 is variably subnetted, 4 subnets, 4 masks
S 192.168.4.0/24 [1/0] via 172.16.4.4
B 192.168.4.64/26 [20/0] via 172.16.3.3, 01:45:10, GigabitEthernet0/2
D 192.168.4.64/27 [90/307200] via 172.16.2.2, 00:15:30, GigabitEthernet0/1
O 192.168.4.64/28 [110/20] via 172.16.1.1, 00:08:12, GigabitEthernet0/0

Which route will the router select to forward the packet?

  1. A
    The static route 192.168.4.0/24 via 172.16.4.4 because static routes have the lowest administrative distance of 1.
  2. B
    The BGP route 192.168.4.64/26 via 172.16.3.3 because exterior gateway protocols override interior gateway routing tables.
  3. The OSPF route 192.168.4.64/28 via 172.16.1.1 because it provides the longest matching prefix for the destination IP address.Answer
  4. D
    The EIGRP route 192.168.4.64/27 via 172.16.2.2 because EIGRP has a lower administrative distance than OSPF while matching the subnet.

Answer

The router selects the OSPF route `192.168.4.64/28` via 172.16.1.1 because it provides the longest prefix match (/28) for the destination IP address 192.168.4.66.
When a router receives a packet, it compares the destination IP address against all routes in its routing table. When multiple routes match the destination IP address, the router selects the route with the longest prefix length (most network bits / longest subnet mask). In this case, 192.168.4.66 matches all four prefixes, but the /28 route is the most specific match (28 bits vs 27, 26, or 24 bits). Administrative distance plays no role here because the prefixes are of different lengths.

Step-by-Step Solution

1
Identify the destination IP address of the incoming packet
Destination IP is 192.168.4.66
Routing lookup is driven by matching the packet's destination IP against routing table entries.
2
Determine which routing table prefixes encompass the destination IP address
192.168.4.0/24 (range .0-.255), 192.168.4.64/26 (range .64-.127), 192.168.4.64/27 (range .64-.95), and 192.168.4.64/28 (range .64-.79) all match the destination address 192.168.4.66.
All four configured subnets contain the IP address 192.168.4.66.
3
Apply the Longest Prefix Match (LPM) rule
The /28 prefix length (28 subnet bits) is the longest and most specific match compared to /27, /26, and /24.
Cisco routers always prioritize the most specific route (longest subnet mask) when forwarding traffic.

Key Concept

Longest Prefix Match (LPM) in IPv4 Route Determination
Estimated Time:1m 0s
Rate this question