Soru

Zorluk: OrtaRouting Table Components

A Cisco router receives an IPv4 packet with a destination IP address of 172.16.50.170. The router inspects its routing table and finds the following route entries:

S 172.16.50.0/24 [1/0] via 10.0.0.1, GigabitEthernet0/0
D 172.16.50.128/25 [90/2560] via 10.0.0.2, GigabitEthernet0/1
O 172.16.50.160/27 [110/50] via 10.0.0.3, GigabitEthernet0/2
S 172.16.50.176/28 [1/0] via 10.0.0.4, GigabitEthernet0/3

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

  1. 10.0.0.3 via GigabitEthernet0/2Cevap
  2. B
    10.0.0.1 via GigabitEthernet0/0
  3. C
    10.0.0.2 via GigabitEthernet0/1
  4. D
    10.0.0.4 via GigabitEthernet0/3

Cevap

10.0.0.3 via GigabitEthernet0/2
When a router performs a forwarding lookup for destination 172.16.50.170, it checks all installed routes to find matches. The prefix 172.16.50.160/27 includes addresses from 172.16.50.160 to 172.16.50.191. Because /27 is the longest (most specific) prefix length among all matching routes, the router selects this entry (next-hop 10.0.0.3 via GigabitEthernet0/2). Administrative distance is not evaluated during lookup across routes of different prefix lengths.

Adım Adım Çözüm

1
Identify all candidate routing table entries that match the destination IP address 172.16.50.170.
Three routes match: 172.16.50.0/24 (range .0 - .255), 172.16.50.128/25 (range .128 - .255), and 172.16.50.160/27 (range .160 - .191). The route 172.16.50.176/28 (range .176 - .191) does not match.
Only matching routes are eligible for forwarding decisions.
2
Compare the prefix lengths of all matching candidate routes.
Prefix lengths are /24, /25, and /27. The longest prefix match is /27.
Routers use the Longest Prefix Match (LPM) rule first when making forwarding decisions.
3
Determine the next-hop and exit interface associated with the longest matching route.
The route 172.16.50.160/27 specifies next-hop 10.0.0.3 out interface GigabitEthernet0/2.
Administrative distance is only evaluated when comparing identical prefixes from different sources, not when comparing routes of different prefix lengths.

Anahtar Kavram

Longest Prefix Match (LPM) Routing Decision Logic
Bu soruyu puanla