Refer to the following routing table snippet from a Cisco router:
text
Codes: C - connected, S - static, O - OSPF, D - EIGRP
Gateway of last resort is not set
D 172.16.10.0/24 [90/2172416] via 10.1.1.1, 00:05:12, GigabitEthernet0/0
O 172.16.10.0/26 [110/20] via 10.1.1.2, 00:12:45, GigabitEthernet0/1
S 172.16.0.0/16 [1/0] via 10.1.1.3
C 172.16.10.128/27 is directly connected, GigabitEthernet0/2
When the router receives an IP packet destined for host 172.16.10.33, which next-hop IP address or interface will be selected to forward the packet?
- 10.1.1.2Cevap
- B10.1.1.3
- C10.1.1.1
- DGigabitEthernet0/2
Cevap
10.1.1.2 via GigabitEthernet0/1 based on Longest Prefix Match (/26).
When forwarding IP packets, a router always evaluates candidate routes using Longest Prefix Match (LPM) first. For the target IP address 172.16.10.33, three candidate routes match: 172.16.0.0/16, 172.16.10.0/24, and 172.16.10.0/26. The OSPF route 172.16.10.0/26 provides the longest matching prefix mask (/26), so the router forwards the packet to next-hop IP 10.1.1.2.
Adım Adım Çözüm
Anahtar Kavram
Router Forwarding Decision Logic (Longest Prefix Match Precedence)