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 . Which interface will the router select to forward this packet?
- GigabitEthernet0/3Cevap
- BGigabitEthernet0/2
- CGigabitEthernet0/1
- DGigabitEthernet0/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
Anahtar Kavram
Longest Prefix Match (LPM) Logic