A Cisco router receives an IPv4 packet destined for host 10.200.15.42. The router inspects its routing table and finds the following entry routes:
text
O 10.200.15.0/24 [110/20] via 172.16.1.1, GigabitEthernet0/0/1
S 10.200.0.0/16 [1/0] via 172.16.2.1, GigabitEthernet0/0/2
D 10.200.15.32/28 [90/307200] via 172.16.3.1, GigabitEthernet0/0/3
B 10.200.15.40/30 [200/0] via 172.16.4.1, GigabitEthernet0/0/4
Which next-hop IP address and outgoing interface will the router select to forward the packet?
- 172.16.4.1 via GigabitEthernet0/0/4 because the 10.200.15.40/30 route has the longest prefix match.Answer
- B172.16.2.1 via GigabitEthernet0/0/2 because the static route has the lowest administrative distance.
- C172.16.3.1 via GigabitEthernet0/0/3 because EIGRP has a lower administrative distance than BGP.
- D172.16.1.1 via GigabitEthernet0/0/1 because the /24 route encompasses the entire subnet.
Answer
The router forwards the packet to next-hop 172.16.4.1 via interface GigabitEthernet0/0/4 because the 10.200.15.40/30 prefix offers the longest prefix match.
When a router receives an IP packet, it compares the destination IP address (10.200.15.42) against all entries in its routing table. The matching entries cover the following ranges:
- 10.200.0.0/16 (/16)
- 10.200.15.0/24 (/24)
- 10.200.15.32/28 (/28: 10.200.15.32 to 10.200.15.47)
- 10.200.15.40/30 (/30: 10.200.15.40 to 10.200.15.43)
Because 10.200.15.42 falls within the /30 range, and /30 is the most specific prefix (longest prefix match), the router selects the entry pointing to 172.16.4.1 via GigabitEthernet0/0/4. Administrative Distance is not evaluated across different prefix lengths.
- 10.200.0.0/16 (/16)
- 10.200.15.0/24 (/24)
- 10.200.15.32/28 (/28: 10.200.15.32 to 10.200.15.47)
- 10.200.15.40/30 (/30: 10.200.15.40 to 10.200.15.43)
Because 10.200.15.42 falls within the /30 range, and /30 is the most specific prefix (longest prefix match), the router selects the entry pointing to 172.16.4.1 via GigabitEthernet0/0/4. Administrative Distance is not evaluated across different prefix lengths.
Step-by-Step Solution
Key Concept
Longest Prefix Match (LPM) Rule
Estimated Time:1m 15s