Soru

Zorluk: OrtaRouting Table Components

An enterprise Cisco router receives an IPv4 packet destined for IP address 192.168.50.75. The router's routing table contains the following entries:

text
Codes: C - connected, S - static, O - OSPF, D - EIGRP

Gateway of last resort is not set

192.168.50.0/24 is variably subnetted, 4 subnets, 3 masks
O 192.168.50.0/24 [110/20] via 10.1.1.1, 00:14:22, GigabitEthernet0/0
S 192.168.50.0/25 [1/0] via 10.3.3.3
D 192.168.50.64/26 [90/30720] via 10.2.2.2, 00:08:15, GigabitEthernet0/1
C 192.168.50.64/28 is directly connected, GigabitEthernet0/2

Which forwarding path will the router select to forward this packet?

  1. Out GigabitEthernet0/2, because 192.168.50.64/28 provides the longest matching prefix for the destination IP address.Cevap
  2. B
    Via next-hop 10.3.3.3, because static routes have a lower administrative distance (1) than directly connected or dynamic routes.
  3. C
    Via next-hop 10.2.2.2, because the EIGRP route provides the optimal balance of administrative distance and subnet mask specificity.
  4. D
    Via next-hop 10.1.1.1, because the /24 route represents the parent network covering all subnets.

Cevap

The router will forward the packet out interface GigabitEthernet0/2 because the directly connected prefix 192.168.50.64/28 provides the longest prefix match (28 matching bits) for the destination IP 192.168.50.75.
When a router makes a packet forwarding decision, it checks all routes in the IPv4 routing table that encompass the destination IP address. The fundamental rule of IP routing is Longest Prefix Match (LPM): the route with the most specific prefix length (largest prefix number) is selected. Here, the target IP 192.168.50.75 falls into 192.168.50.64/28 (range .64 to .79). Because /28 is longer than /26, /25, and /24, the router forwards the packet directly out GigabitEthernet0/2.

Adım Adım Çözüm

1
Determine subnet ranges for all routing table entries
192.168.50.0/24 covers 192.168.50.0–192.168.50.255; 192.168.50.0/25 covers 192.168.50.0–192.168.50.127; 192.168.50.64/26 covers 192.168.50.64–192.168.50.127; 192.168.50.64/28 covers 192.168.50.64–192.168.50.79.
Identify which routes in the routing table actually match the destination IP address 192.168.50.75.
2
Check destination IP 192.168.50.75 against matching subnets
The destination address 192.168.50.75 matches all four listed routes in the routing table.
All four routes enclose the IP address 192.168.50.75 within their network address boundaries.
3
Apply the Longest Prefix Match (LPM) rule
Prefix lengths are /24, /25, /26, and /28. The /28 prefix has the greatest number of matching subnet mask bits.
Cisco IOS routing logic prioritizes the most specific prefix (longest netmask / highest prefix length) first before evaluating Administrative Distance or Metric.

Anahtar Kavram

Longest Prefix Match (LPM) Rule in Cisco IPv4 Routing
Bu soruyu puanla