Soru

Zorluk: OrtaRouting Table Components

A Cisco router displays the following partial routing table output:

text
Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 4 subnets, 3 masks
O 10.150.0.0/16 [110/20] via 192.168.12.2, 00:14:22, GigabitEthernet0/0
D 10.150.32.0/19 [90/2578560] via 192.168.23.2, 00:05:10, GigabitEthernet0/1
S 10.150.32.0/24 [1/0] via 192.168.34.2, 01:12:00, GigabitEthernet0/2
O IA 10.150.32.128/26 [110/30] via 192.168.45.2, 00:02:45, GigabitEthernet0/3

The router receives a packet destined for 10.150.32.13510.150.32.135. Which interface will the router select to forward this packet?

  1. GigabitEthernet0/3Cevap
  2. B
    GigabitEthernet0/2
  3. C
    GigabitEthernet0/1
  4. D
    GigabitEthernet0/0

Cevap

The router forwards the packet out of interface GigabitEthernet0/3 because the route 10.150.32.128/26 provides the longest matching prefix for destination IP 10.150.32.135.
When a router makes a forwarding decision, it evaluates all matching routing table entries and selects the route with the longest prefix mask (the most specific match). The destination IP address 10.150.32.135 falls into the subnet 10.150.32.128/26 (range 10.150.32.128 through 10.150.32.191). Because /26 is the longest subnet mask among all valid candidate routes, the router forwards the packet out of GigabitEthernet0/3.

Adım Adım Çözüm

1
Identify candidate routes matching the destination IP address 10.150.32.135
Candidate routes include: 10.150.0.0/16, 10.150.32.0/19, 10.150.32.0/24, and 10.150.32.128/26 (range 10.150.32.128–10.150.32.191). All four candidate routes match the destination IP address.
Before comparing routing metrics or administrative distances, a router first evaluates all installed routes to determine which prefix ranges encompass the destination IP.
2
Apply the Longest Prefix Match (LPM) rule
The prefix 10.150.32.128/26 has a 26-bit mask length, which is longer than /24, /19, and /16.
Routers always prefer the route with the most specific (longest prefix mask) match regardless of administrative distance or metric.
3
Determine the egress interface associated with the longest prefix match route
The entry 10.150.32.128/26 specifies next-hop 192.168.45.2 via interface GigabitEthernet0/3.
The forwarding decision is dictated by the interface bound to the winning longest prefix route.

Anahtar Kavram

Longest Prefix Match (LPM) Logic
Bu soruyu puanla