An engineer is troubleshooting IPv4 packet forwarding on a Cisco IOS-XE router. The router receives a packet with a destination IP address of 172.16.100.70. Refer to the routing table output below:
text
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
Gateway of last resort is 10.0.0.1 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 10.0.0.1
S 172.16.100.0/24 [1/0] via 10.1.1.1
O 172.16.100.64/27 [110/50] via 10.2.2.2
D 172.16.100.64/28 [90/2170112] via 10.3.3.3
C 172.16.100.64/30 is directly connected, GigabitEthernet0/0/0
Which next-hop IP address or outgoing interface will the router select to forward this packet?
- 10.3.3.3Cevap
- B10.1.1.1
- C10.2.2.2
- DGigabitEthernet0/0/0
Cevap
The router will forward the packet to next-hop IP address 10.3.3.3.
The router follows the Longest Prefix Match (LPM) algorithm for packet forwarding. For destination 172.16.100.70, the matching routes in the table are 0.0.0.0/0, 172.16.100.0/24, 172.16.100.64/27 (range 172.16.100.64–172.16.100.95), and 172.16.100.64/28 (range 172.16.100.64–172.16.100.79). Among these valid matches, /28 is the most specific mask (longest prefix length). Administrative Distance and metric are only compared when two routes have the exact same prefix length. Therefore, the router chooses the /28 route with next-hop 10.3.3.3.
Adım Adım Çözüm
Anahtar Kavram
Longest Prefix Match (LPM) Rule in Cisco IPv4 Forwarding Logic