A Cisco router receives an IP packet with a destination address of 10.45.12.85. Examine the following excerpt from the router's routing table:
text
Gateway of last resort is 192.168.1.1 to network 0.0.0.0
O 10.45.12.0/25 [110/20] via 192.168.12.2, GigabitEthernet0/0/1
D 10.45.12.64/26 [90/307200] via 192.168.14.2, GigabitEthernet0/0/2
S 10.45.12.80/28 [1/0] via 192.168.16.2, GigabitEthernet0/0/3
O 10.45.12.80/29 [110/50] via 192.168.18.2, GigabitEthernet0/0/4
Which next-hop IP address and exit interface will the router select to forward this packet?
- 192.168.18.2 via GigabitEthernet0/0/4 because 10.45.12.80/29 is the longest matching prefix for the destination IP address.Cevap
- B192.168.16.2 via GigabitEthernet0/0/3 because the static route has the lowest administrative distance among matching routes.
- C192.168.14.2 via GigabitEthernet0/0/2 because EIGRP has a lower administrative distance than the OSPF route matching 10.45.12.80/29.
- D192.168.12.2 via GigabitEthernet0/0/1 because 10.45.12.85 is an invalid host address in a /29 subnet, forcing a fallback to the /25 route.
Cevap
The router forwards the packet to next-hop IP 192.168.18.2 via exit interface GigabitEthernet0/0/4 based on the Longest Prefix Match rule.
When a router receives a packet, it compares the destination IP address (10.45.12.85) against all entries in the routing table. It selects the route with the most specific match (the longest subnet mask prefix length). In this scenario, 10.45.12.80/29 matches 10.45.12.85 (range 10.45.12.80–10.45.12.87) with a 29-bit prefix length, which is longer than /28, /26, /25, or /0. Consequently, the router routes traffic out GigabitEthernet0/0/4 to 192.168.18.2. Administrative distance is ignored because the matching routes do not have identical prefix lengths.
Adım Adım Çözüm
Anahtar Kavram
Longest Prefix Match (LPM) Rule in Cisco Forwarding Decision Logic
Tahmini Süre:1m 30s