A Cisco router's IPv4 routing table contains the following entries:
text
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 5 subnets, 3 masks
O 10.180.0.0/14 [110/65] via 192.168.12.2, 00:04:12, GigabitEthernet0/0/1
D 10.180.0.0/16 [90/307200] via 192.168.10.2, 01:15:04, GigabitEthernet0/0/0
S 10.180.32.0/19 [1/0] via 192.168.15.1, GigabitEthernet0/0/3
O IA 10.180.40.0/22 [110/120] via 192.168.14.2, 00:10:05, GigabitEthernet0/0/2
When a packet destined for IP address 10.180.42.100 arrives at the router, which route entry will the router select to forward the packet?
- AThe static route to 10.180.32.0/19 because static routes have a lower Administrative Distance (1) than OSPF or EIGRP.
- The OSPF inter-area route to 10.180.40.0/22 because it provides the longest prefix match for the destination address.Answer
- CThe EIGRP route to 10.180.0.0/16 because EIGRP has a lower Administrative Distance (90) than OSPF (110).
- DThe OSPF intra-area route to 10.180.0.0/14 because intra-area routes are always preferred over inter-area routes regardless of mask length.
Answer
The router will select the OSPF inter-area route to 10.180.40.0/22 because 10.180.42.100 matches that route with a /22 prefix length, which is the longest matching prefix.
The destination address 10.180.42.100 matches multiple entries in the routing table. Cisco routers evaluate forwarding decisions using the Longest Prefix Match rule, which prioritizes the route with the longest subnet mask length regardless of administrative distance or metric. The route 10.180.40.0/22 covers range 10.180.40.0 to 10.180.43.255, giving a 22-bit matching prefix, which is longer than /19, /16, or /14.
Step-by-Step Solution
Key Concept
Longest Prefix Match Rule in Cisco Routing Tables