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?
- AThe static route 192.168.4.0/24 via 172.16.4.4 because static routes have the lowest administrative distance of 1.
- BThe BGP route 192.168.4.64/26 via 172.16.3.3 because exterior gateway protocols override interior gateway routing tables.
- 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
- DThe 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
Key Concept
Longest Prefix Match (LPM) in IPv4 Route Determination
Estimated Time:1m 0s