ARP Subnet – How the ARP Table Works in Case of the Gateway Router

arpnetwork accesssubnet

Suppose I am a host, I understand how ARP works in case I address an IP within my subnet. For each IP address there is a corresponding MAC address, and the owner responds to my broadcast ARP query. However, for external IPs, my ARP table is actually not one to one.

Does ARP work this way in this case: 1-Host broadcasts an external IP address to the subnet asking who this is, 2- gateway router responds with its MAC, 3- For another external IP the process repeats again and again…

In this case, how does the router know that it should respond all these different external addresses with its own MAC?

Best Answer

You've got a misconception there:

Does ARP work this way in this case: 1-Host broadcasts an external IP address to the subnet asking who this is, 2- gateway router responds with its MAC, 3- For another external IP the process repeats again and again...

It doesn't work that way. The usual case for hosts is much simpler: it uses its own IP address and network mask to decide if the target IP address is local or not. If local, then it uses ARP to resolve the MAC address, if remote it uses ARP to resolve the MAC address of the default gateway. Then it sends the packet. ("Uses ARP" = look in cache, if not found, make ARP request, wait for ARP response.)

Hosts with many interfaces do the "is-it-local" test for each interface. Hosts with many routes decide which gateway is next-hop depending on target IP address.

There is a technique which is like what you are thinking of, called "proxy ARP". Others tell me in comments it's still current, but personally I haven't seen used in anger for over 20 years. In this scheme you tell the gateway to respond to ARP requests for other hosts. Details in RFC 1027 and Cisco doc.