An engineer is troubleshooting packet forwarding on router R1. A packet arrives at R1 with a destination IP address of 172.16.45.100.
Refer to the command output from R1:
text
R1# show ip route
Gateway of last resort is 10.0.0.5 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 10.0.0.5
S 172.16.0.0/16 [1/0] via 10.0.0.1
O 172.16.45.0/24 [110/20] via 10.0.0.2
B 172.16.45.96/28 [20/0] via 10.0.0.4
Which next-hop IP address will router R1 use to forward this packet?
- 10.0.0.4Cevap
- B10.0.0.1
- C10.0.0.2
- D10.0.0.5
Cevap
Router R1 will forward the packet to the next-hop IP address 10.0.0.4 based on the Longest Prefix Match rule.
When a router receives a packet, it compares the destination IP address against all routes in the routing table. If multiple routes match, the router strictly prefers the route with the most specific (longest) subnet mask (Longest Prefix Match). In this scenario, 172.16.45.100 matches 0.0.0.0/0, 172.16.0.0/16, 172.16.45.0/24, and 172.16.45.96/28. The /28 prefix is the longest match, so the packet is routed via next-hop 10.0.0.4.
Adım Adım Çözüm
Anahtar Kavram
Router Forwarding Decision Logic & Longest Prefix Match