Soru

Zorluk: OrtaRouter Forwarding Decision Logic

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?

  1. 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
  2. B
    192.168.16.2 via GigabitEthernet0/0/3 because the static route has the lowest administrative distance among matching routes.
  3. C
    192.168.14.2 via GigabitEthernet0/0/2 because EIGRP has a lower administrative distance than the OSPF route matching 10.45.12.80/29.
  4. D
    192.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

1
Identify all candidate routes matching destination IP 10.45.12.85
Candidate routes: 10.45.12.0/25 (range .0-.127), 10.45.12.64/26 (range .64-.127), 10.45.12.80/28 (range .80-.95), 10.45.12.80/29 (range .80-.87), and default route 0.0.0.0/0.
The router compares the destination IP address against all routing table prefix entries.
2
Apply the Longest Prefix Match rule to determine the winning route
The route 10.45.12.80/29 has the longest prefix mask (/29 = 29 matching bits).
Prefix length (/29 > /28 > /26 > /25 > /0) takes precedence over administrative distance and metric during forwarding lookup.
3
Extract the next-hop IP and exit interface associated with the longest matching route
Next-hop: 192.168.18.2, Exit Interface: GigabitEthernet0/0/4.
The router uses the interface and gateway specified by the selected longest matching routing table entry.

Anahtar Kavram

Longest Prefix Match (LPM) Rule in Cisco Forwarding Decision Logic
Tahmini Süre:1m 30s
Bu soruyu puanla