Soru

Zorluk: ZorRouting Table Components

An enterprise router displays the following output from the `show ip route` command:

text
Gateway of last resort is not set

172.20.0.0/16 is subnetted, 4 subnets
S 172.20.0.0/16 [1/0] via 10.10.10.1
O 172.20.8.0/21 [110/65] via 10.10.20.1, 00:08:12, GigabitEthernet0/0/1
D 172.20.12.0/23 [90/2578560] via 10.10.30.1, 00:22:45, GigabitEthernet0/0/2
O 172.20.13.0/25 [110/110] via 10.10.40.1, 00:03:50, GigabitEthernet0/0/3

The router receives a packet with a destination IPv4 address of 172.20.13.45172.20.13.45. Based on the routing table components and forwarding logic, which next-hop IP address and outbound interface will the router select to forward this packet?

  1. 10.10.40.1 via GigabitEthernet0/0/3Cevap
  2. B
    10.10.10.1 via the static route next-hop
  3. C
    10.10.30.1 via GigabitEthernet0/0/2
  4. D
    10.10.20.1 via GigabitEthernet0/0/1

Cevap

Next-hop 10.10.40.1 via GigabitEthernet0/0/3
When a router receives an IP packet, it evaluates all matching prefix entries in its routing table and selects the entry with the longest prefix length (most specific mask). The destination address 172.20.13.45 falls within the range of 172.20.13.0/25 (172.20.13.0 to 172.20.13.127), which has a /25 prefix length. Because /25 is longer and more specific than /23, /21, or /16, the router forwards the packet to next-hop 10.10.40.1 out interface GigabitEthernet0/0/3 regardless of Administrative Distance.

Adım Adım Çözüm

1
Identify all candidate routes that match the destination IP address 172.20.13.45
Candidate routes are 172.20.0.0/16, 172.20.8.0/21 (range 172.20.8.0 - 172.20.15.255), 172.20.12.0/23 (range 172.20.12.0 - 172.20.13.255), and 172.20.13.0/25 (range 172.20.13.0 - 172.20.13.127). All 4 entries encompass the destination address.
Before comparing route metrics or administrative distances, the router determines which routing table prefixes physically include the destination IP.
2
Apply the Longest Prefix Match (LPM) rule across all candidate matching entries
Prefix lengths are /16, /21, /23, and /25. The longest and most specific prefix mask is /25 (172.20.13.0/25).
The router forwarding decision logic always prioritizes the most specific prefix (highest prefix length value) over Administrative Distance or metric.
3
Determine the next-hop IP and exit interface associated with the winning route prefix
The route for 172.20.13.0/25 specifies next-hop 10.10.40.1 via interface GigabitEthernet0/0/3.
Packet forwarding parameters are derived directly from the winning prefix entry in the Routing Information Base.

Anahtar Kavram

Longest Prefix Match (LPM) resolution in Cisco routing tables
Bu soruyu puanla