Soru

Zorluk: OrtaRouting Table Components

A Cisco router receives an IP packet destined for host 172.20.16.68. The network engineer checks the routing table and observes the following entries:

text
C 172.20.16.0/23 is directly connected, GigabitEthernet0/0/0
S 172.20.16.0/25 [1/0] via 192.168.1.1, GigabitEthernet0/0/1
D 172.20.16.64/27 [90/2570240] via 192.168.1.5, GigabitEthernet0/0/2
O 172.20.16.64/28 [110/30] via 192.168.1.9, GigabitEthernet0/0/3

Which next-hop IP address and outgoing interface will the router select to forward this packet?

  1. Next-hop 192.168.1.9 via GigabitEthernet0/0/3Cevap
  2. B
    Next-hop 192.168.1.1 via GigabitEthernet0/0/1
  3. C
    Next-hop 192.168.1.5 via GigabitEthernet0/0/2
  4. D
    Directly connected interface GigabitEthernet0/0/0 without a next-hop IP

Cevap

The router will select next-hop 192.168.1.9 via interface GigabitEthernet0/0/3 because the /28 route provides the longest prefix match for destination 172.20.16.68.
When a router performs a destination lookup in the routing table, it evaluates all matching entries and selects the route with the most specific prefix length (Longest Prefix Match). The host address 172.20.16.68 falls within all four candidate subnet ranges, but 172.20.16.64/28 has the highest mask length (/28 > /27 > /25 > /23). Therefore, the router forwards the packet using next-hop 192.168.1.9 via GigabitEthernet0/0/3 regardless of the higher administrative distance of OSPF.

Adım Adım Çözüm

1
Determine which routing table entries match the destination IP address 172.20.16.68.
All four routes cover 172.20.16.68:
- 172.20.16.0/23 covers 172.20.16.0 - 172.20.17.255
- 172.20.16.0/25 covers 172.20.16.0 - 172.20.16.127
- 172.20.16.64/27 covers 172.20.16.64 - 172.20.16.95
- 172.20.16.64/28 covers 172.20.16.64 - 172.20.16.79
Before comparing metrics or administrative distance, the router must evaluate match candidates against the destination address.
2
Apply the Longest Prefix Match (LPM) rule to select the best route.
The subnet masks are /23, /25, /27, and /28. The /28 route is the most specific prefix (longest prefix match).
Cisco IP forwarding logic always prioritizes prefix length over administrative distance or metric when multiple matching routes exist.
3
Identify the next-hop and interface associated with the longest matching prefix.
The OSPF route 172.20.16.64/28 specifies next-hop 192.168.1.9 via GigabitEthernet0/0/3.
This entry dictates the forwarding decision.

Anahtar Kavram

Longest Prefix Match (LPM) in IP Routing
Bu soruyu puanla