Study FAQ
Which address does an IPv4 host resolve with ARP for local and remote traffic?
Also asked as 2
- How does a host decide whether to resolve the peer's MAC address or the gateway's?
- Which IP address should appear in ARP for a local or remote IPv4 destination?
Answer
An IPv4 host uses Address Resolution Protocol (ARP) to find the MAC address of the next hop on its local Ethernet link. For a directly connected destination that next hop is the destination host. For a route through a gateway it is the gateway, while the IP packet still names the remote host as its destination.
Suppose the host is 192.0.2.77/26, its default gateway is 192.0.2.65, and it has the usual connected and default routes with no overriding route or proxy ARP. The connected prefix is 192.0.2.64/26.
192.0.2.93is inside that prefix. If the cache lacks a usable entry, the host resolves192.0.2.93.192.0.2.140belongs to192.0.2.128/26. The host uses the default route and resolves192.0.2.65.
Initial ARP requests in this scenario are local VLAN broadcasts. An existing neighbor entry may avoid a new broadcast, and later cache validation can use unicast. To check an unexpected result, compare the actual masks at both endpoints, the interface and next hop selected by the host's route lookup, and the neighbor entry for that next hop. If the local resolution succeeds, verify the return route and policy separately.
References
Full explanation
HPE6-A86: IPv4 Subnetting, ARP and the Next-Hop Decision
Study guide · HPE6-A86
Read the full explanation