Proxy ARP, Gratuitous ARP, Address Conflict Detection and ARP Attacks
The other uses of ARP: proxy ARP, gratuitous ARP for failover, address conflict detection (RFC 5227), static entries and the arp command, setting an embedded device's address, and how ARP spoofing works and is stopped.
kvi5hnuCode Sprout team member17 min readOn this page
ARP's basic job is simple (article 21): ask who has an address, get an answer. But because ARP has no authentication and hosts trust whatever it tells them, the same message can be used in several other ways, some helpful and one very harmful. This article covers them all, with each one run in the lab.
Proxy ARP
With proxy ARP, a router answers ARP requests on behalf of hosts on another network, giving its own MAC address. The asking host then sends the packets to the router, which forwards them. The host never needs to know that a router is involved.
The lab gave host h1 (192.0.2.10) a route saying that 198.51.100.0/24 is directly on its link, with no gateway, while that subnet is actually behind router r:
192.0.2.0/24 dev eth0 proto kernel scope link src 192.0.2.10
198.51.100.0/24 dev eth0 scope link
Without help, h1's ARP requests for 198.51.100.20 go unanswered, because that host isn't on the link:
2 packets transmitted, 0 received, 100% packet loss, time 1013ms
Then proxy ARP was enabled on the router's interface toward h1, and the same ping worked. The diagram after the output shows the path the packets took:
net.ipv4.conf.e0.proxy_arp = 1
64 bytes from 198.51.100.20: icmp_seq=1 ttl=63 time=386 ms
64 bytes from 198.51.100.20: icmp_seq=2 ttl=63 time=0.110 ms
2 packets transmitted, 2 received, 0% packet loss, time 1007ms

The router answered for 198.51.100.20 with its own MAC address, because it has a route to that address through a different interface:
02:00:00:00:00:01 > ff:ff:ff:ff:ff:ff, Request who-has 198.51.100.20 tell 192.0.2.10
02:00:00:00:01:01 > 02:00:00:00:00:01, Reply 198.51.100.20 is-at 02:00:00:00:01:01
198.51.100.20 dev eth0 lladdr 02:00:00:00:01:01 REACHABLE
The first ping took a noticeable fraction of a second because Linux delays proxy replies by a random time up to proxy_delay (0.8 seconds by default), so that the real host, if it is on the link after all, can answer first. The ping's TTL of 63 shows that a router was involved: TTL (time to live) is a hop counter that every router decrements by one (article 23), and Linux starts it at 64.
Proxy ARP used to hide subnetting from hosts that didn't understand masks, and it still appears in several places:
- Dial-up and VPN (virtual private network) servers give remote clients addresses from the server's LAN and answer ARP for them, so LAN hosts can reach the clients as if they were local.
- Mobile IP home agents use it to catch packets for a mobile node that is away (article 28), though Mobile IP itself is rarely deployed today.
- Wi-Fi access points and some switches answer ARP for their clients so the broadcasts don't have to reach sleeping devices (article 21).
- Virtual and cloud networks often answer all ARP requests centrally, sometimes with the gateway's MAC for every address.
Proxy ARP also hides configuration mistakes, such as a wrong subnet mask, that would otherwise be noticed quickly, and it makes the ARP cache less informative, since many addresses map to one MAC address. Many routers have it on by default on LAN interfaces (Cisco IOS, Cisco's router operating system, does), and Linux has it off (net.ipv4.conf.<interface>.proxy_arp).
Gratuitous ARP
A gratuitous ARP is a request (or, from some implementations, a reply) in which a host asks about its own address: the sender and target IP addresses are the same. Nobody should answer, so the point isn't the answer. It serves two other purposes:
- Updating other hosts' caches. Every host that already has an entry for that address updates it from the sender fields. This is how a backup server or router takes over an address after a failure, and how a host announces a changed network card.
- Detecting a conflict. If someone does answer, another host is using the same address.
In the lab, a had a cache entry for b. Then b's address moved to new hardware with a different MAC address, as in a failover, and announced itself with arping -U (-U for unsolicited). The three outputs below are a's cache entry before, the gratuitous ARP on the wire, and a's entry after:
192.0.2.2 dev eth0 lladdr 02:00:00:00:0b:01 REACHABLE
02:00:00:00:0b:99 > ff:ff:ff:ff:ff:ff, Request who-has 192.0.2.2 (ff:ff:ff:ff:ff:ff) tell 192.0.2.2
192.0.2.2 dev eth0 lladdr 02:00:00:00:0b:99 STALE
a's entry was updated to the new MAC address immediately, without a asking. Without the gratuitous ARP, a would have kept sending to the old MAC address until its entry went stale and was probed, which takes up to a minute or so (article 21). Decoded, the frame shows the telltale same sender and target IP:
Address Resolution Protocol (request/gratuitous ARP)
Hardware type: Ethernet (1)
Protocol type: IPv4 (0x0800)
Hardware size: 6
Protocol size: 4
Opcode: request (1)
[Is gratuitous: True]
Sender MAC address: 02:00:00:00:0b:99
Sender IP address: 192.0.2.2
Target MAC address: Broadcast
Target IP address: 192.0.2.2
High-availability software such as keepalived (which implements VRRP, the Virtual Router Redundancy Protocol for sharing a gateway address between routers), Pacemaker and cloud load balancers sends gratuitous ARPs whenever an address moves, usually several in a row in case one is lost. Linux can send one automatically when an interface comes up or its address changes (net.ipv4.conf.<interface>.arp_notify=1).
Linux updates existing entries from gratuitous ARPs but by default doesn't create new ones from them (arp_accept controls that), which limits how much an unsolicited packet can insert into the cache.
Address conflict detection (RFC 5227)
Gratuitous ARP detects conflicts only after the address is already in use, when two hosts may already have damaged each other's connections. IPv4 Address Conflict Detection (ACD), RFC 5227, checks first, using ARP probes: requests with the address being tested as the target and a sender IP of 0.0.0.0. Because the sender IP is zero, a probe doesn't claim the address or change anyone's cache. It just asks whether anyone already uses it. The figure compares the three kinds of ARP request you've now met, by their sender and target IP fields.

Host c probed two addresses: 192.0.2.2, which b uses, and 192.0.2.50, which nobody uses:
ARPING 192.0.2.2 from 0.0.0.0 eth0
Unicast reply from 192.0.2.2 [02:00:00:00:0B:99] 0.519ms
Sent 1 probes (1 broadcast(s))
Received 1 response(s)
arping exit status: 1 (1 = someone answered: address in use)
ARPING 192.0.2.50 from 0.0.0.0 eth0
Sent 2 probes (2 broadcast(s))
Received 0 response(s)
arping exit status: 0 (0 = no answer: address free)
02:00:00:00:0c:01 > ff:ff:ff:ff:ff:ff, Request who-has 192.0.2.2 (ff:ff:ff:ff:ff:ff) tell 0.0.0.0
02:00:00:00:0b:99 > 02:00:00:00:0c:01, Reply 192.0.2.2 is-at 02:00:00:00:0b:99
02:00:00:00:0c:01 > ff:ff:ff:ff:ff:ff, Request who-has 192.0.2.50 (ff:ff:ff:ff:ff:ff) tell 0.0.0.0
02:00:00:00:0c:01 > ff:ff:ff:ff:ff:ff, Request who-has 192.0.2.50 (ff:ff:ff:ff:ff:ff) tell 0.0.0.0
b answered the probe for its address, so c knows not to use it. Nobody answered for 192.0.2.50. (The arping tool sets the target MAC to all ones, while RFC 5227 suggests zeros, and receivers ignore the field either way.)
The full RFC 5227 procedure:
- Wait a random time up to 1 second (so hosts that start together don't probe together), then send 3 probes, 1 to 2 seconds apart.
- If any ARP packet arrives with the tested address as its sender, or another host's probe for the same address arrives, there's a conflict: don't use the address.
- Otherwise, after a final wait of 2 seconds, start using the address and send 2 announcements (gratuitous ARPs) 2 seconds apart.
- Keep watching. If another host later claims the address, defend it with one more announcement, but if conflicts keep coming within 10 seconds, give the address up rather than fight forever.
DHCP clients are expected to do this before using a leased address, and many do: Windows, macOS, and NetworkManager on Linux. If a conflict is found, the client declines the lease (DHCPDECLINE, article 30). IPv4 link-local addressing (169.254.0.0/16, article 32) relies on the same probes, and IPv6 has the equivalent duplicate address detection built into Neighbor Discovery.
The arp command and static entries
Besides ip neigh on Linux, the traditional arp command exists almost everywhere. arp -a lists the cache, arp -d deletes an entry, and arp -s adds a static one. Static entries never expire and aren't changed by any ARP packet:
192.0.2.2 dev eth0 lladdr 02:00:00:00:0b:99 PERMANENT
On Linux, ip neigh replace <address> lladdr <mac> dev <interface> nud permanent adds one, as above. On Windows, netsh interface ipv4 add neighbors "Ethernet" 192.0.2.2 02-00-00-00-0b-99, and on macOS sudo arp -s 192.0.2.2 02:00:00:00:0b:99.
Some systems also support published entries (arp -s ... pub): the host answers ARP requests for that address with the given MAC, a manual form of proxy ARP.
Setting an embedded device's address with ARP
Some network printers, cameras and other embedded devices can be given an IP address without a console or DHCP, using a static ARP entry:
- Read the device's MAC address from its label.
- On a computer on the same LAN, add a static entry mapping the desired IP address to that MAC:
arp -s 192.0.2.77 00-00-5e-00-53-77(the MAC here is a documentation example). - Send a ping to
192.0.2.77. Because of the static entry, the computer skips ARP and sends the ping directly to the device's MAC address. - The device, which has no address yet, sees an ICMP echo request addressed to its MAC and adopts the destination IP address as its own.
It works only with devices designed to do this, and only on the local link. Most devices now use DHCP or a setup app instead.
ARP spoofing and poisoning
ARP has no authentication. A host accepts a reply even if it never asked, and updates its cache from any request or reply that mentions an address it already knows. So any device on the LAN can send forged messages saying "the gateway's IP address is at my MAC address". This is ARP spoofing or ARP cache poisoning, and it's the classic way to become a man in the middle on a LAN: a device that secretly relays traffic between two parties and can read or change it.
The lab ran the attack with three hosts on one bridge: a victim v (192.0.2.10), its gateway gw (192.0.2.1) and an attacker m (192.0.2.66). The attacker enabled IP forwarding, so the victim's traffic would still reach its destination and nothing would look broken, then sent forged replies twice a second: to the victim, claiming to be the gateway, and to the gateway, claiming to be the victim. The outputs below show the victim's entry for its gateway before the attack, then how it changed over time, and the chart plots the same timeline. The attacker's MAC is the one ending in :66.
192.0.2.1 dev eth0 lladdr 02:00:00:00:00:01 REACHABLE
0.0 s victim's cache: 192.0.2.1 is at 02:00:00:00:00:01
3.3 s victim's cache: 192.0.2.1 is at 02:00:00:00:00:66
25.7 s victim's cache: 192.0.2.1 is at 02:00:00:00:00:01

From the first forged reply, the victim sent everything for its gateway to the attacker. The attacker's capture shows the victim's pings and the gateway's replies, each appearing twice: once as it arrives and once as the attacker forwards it on:
the attacker's capture of the victim's pings to its gateway:
IP 192.0.2.10 > 192.0.2.1: ICMP echo request, id 64, seq 6, length 64
IP 192.0.2.10 > 192.0.2.1: ICMP echo request, id 64, seq 6, length 64
IP 192.0.2.1 > 192.0.2.10: ICMP echo reply, id 64, seq 6, length 64
IP 192.0.2.1 > 192.0.2.10: ICMP echo reply, id 64, seq 6, length 64
Even after the attacker stopped sending forged replies, the poisoned entry stayed in place, because traffic kept flowing through the attacker and kept confirming the entry. Only when the attacker also stopped forwarding did the victim's pings go unanswered, its entry go stale, and its probes of the attacker's MAC fail. Then it asked again with a broadcast and the real gateway answered. With the lab's shortened timers that took more than 10 seconds, and with default timers it takes longer. In a real attack, the forged replies simply never stop.
With the traffic flowing through them, an attacker can read anything unencrypted, change it, or block it. Variants of the same idea:
- Denial of service: map the gateway's address to a MAC address that doesn't exist, cutting the victim off.
- Claiming an address with gratuitous ARPs, so that traffic for a server goes to the attacker.
- Flooding the switch's MAC table instead (article 20), which makes the switch send traffic everywhere.
The lab also showed the simplest defense on a single host: a static entry for the gateway. After the victim added one, 3 seconds of forged replies changed nothing:
after 3 s of forged replies: 192.0.2.1 dev eth0 lladdr 02:00:00:00:00:01 PERMANENT
Static entries don't scale and break when hardware changes, so networks use other defenses:
- Dynamic ARP Inspection (DAI) on switches checks every ARP packet on untrusted (user-facing) ports against a table of legitimate IP-to-MAC bindings, usually built by DHCP snooping from the DHCP leases the switch has seen (article 30), and drops forged ones.
- Port security and 802.1X restrict which devices can connect at all (articles 20 and 81).
- Client isolation (private VLANs, or "AP isolation" on Wi-Fi) prevents user devices from talking to each other directly, so they can't reach each other with ARP either.
- Monitoring tools such as
arpwatchlog changes of IP-to-MAC mappings, which often reveal spoofing. - Encryption at higher layers (TLS, SSH, VPNs) doesn't stop the redirection but makes the intercepted traffic useless, and certificate checks reveal attempts to impersonate servers.
IPv6 Neighbor Discovery has the same weakness, and its defenses (RA Guard, which blocks forged router advertisements; ND inspection; and SEND, Secure Neighbor Discovery) are covered in article 42.
Linux settings for multihomed hosts
Linux answers ARP requests for any of its addresses on any interface by default, because addresses belong to the host, not to interfaces (the weak host model, article 28). On a host with several interfaces on the same LAN, that can produce confusing replies. Three per-interface settings control it:
arp_ignore=1answers only requests for addresses configured on the interface the request arrived on.arp_announce=2always uses an address of the outgoing interface as the sender IP in ARP requests.arp_filter=1answers only if the kernel would route the reply out the interface the request came in on.
Load balancers that share a virtual IP among several servers (direct server return) depend on these settings, so that only the balancer answers ARP for the shared address.
Common questions
Is proxy ARP a security risk?
Not directly, but it makes a router answer for many addresses, which can hide misconfigurations and confuse troubleshooting. Turn it off on interfaces where it isn't needed. It's also unrelated to ARP spoofing: proxy ARP is the router answering honestly for addresses it can reach.
Why do I see two identical gratuitous ARPs when my laptop connects?
The operating system is announcing its address, often after an ACD probe, and RFC 5227 asks for two announcements in case one is lost. You may also see them when a virtual machine migrates, or when a high-availability address moves.
How can I tell if someone is spoofing ARP on my network?
Signs are several IP addresses mapping to one MAC address in your cache (other than a router with proxy ARP), the gateway's MAC address changing unexpectedly (arpwatch logs this), or a stream of unrequested ARP replies in a capture. Switches with DAI log dropped packets.
Does a static ARP entry for my gateway protect me completely?
It protects your host's outgoing traffic from being redirected by forged ARP. It doesn't stop the attacker from poisoning the gateway's entry for you, which redirects the return traffic, and it doesn't stop MAC flooding or other attacks. Use network-side defenses where you can.
Is ARP used for IPv4 link-local addresses?
Yes. A host choosing an address in 169.254.0.0/16 picks one at random and uses ACD probes to make sure nobody else has it, then announces it with gratuitous ARPs.
What's the difference between an ARP probe and an announcement?
A probe has sender IP 0.0.0.0 and only asks. It claims nothing and changes no cache. An announcement has the host's own address as both sender and target IP and updates every cache that already holds the address.
Summary
- Proxy ARP lets a router answer ARP requests for addresses it can reach elsewhere, using its own MAC address. It's used by VPN and dial-in servers, Mobile IP, access points and cloud networks, and Linux delays the replies by up to 0.8 seconds.
- Gratuitous ARP announces a host's own address (sender IP = target IP). It updates existing cache entries immediately, which makes failover work, and an answer reveals a conflict.
- Address Conflict Detection (RFC 5227) checks first with ARP probes from
0.0.0.0: three probes, then two announcements, then defense of the address. DHCP clients and IPv4 link-local addressing use it. - Static entries (
ip neigh ... nud permanent,arp -s) never expire and can't be changed by ARP packets. A static entry plus a ping can assign an address to some embedded devices. - ARP spoofing sends forged replies to redirect traffic through an attacker, for interception or denial of service. Defenses are static entries for critical hosts, Dynamic ARP Inspection with DHCP snooping, port security and 802.1X, client isolation, monitoring and encryption.
arp_ignore,arp_announceandarp_filtercontrol how Linux answers ARP on multihomed hosts.
Practice questions
1. Host 192.0.2.10/24 was misconfigured with an on-link route for 203.0.113.0/24 (no gateway), and tries to reach 203.0.113.20, which is behind the LAN's router. What happens with proxy ARP disabled, and with it enabled on the router?
Answer
Because of the on-link route, the host thinks 203.0.113.20 is on its own link and broadcasts an ARP request for it instead of using the gateway. Without proxy ARP, nobody answers and the connection fails, which reveals the misconfiguration. With proxy ARP, the router answers with its own MAC address, the host sends the packets to the router, and everything works, so the wrong route goes unnoticed. A wrong subnet mask that makes a remote network look local has the same effect.
2. A gratuitous ARP from 02:00:00:00:0b:99 says sender 192.0.2.2, target 192.0.2.2. Host A has an entry 192.0.2.2 → 02:00:00:00:0b:01, and host C has no entry for 192.0.2.2. What does each do (Linux defaults)?
Answer
Host A updates its existing entry to 02:00:00:00:0b:99. Host C ignores the packet for its cache, because Linux doesn't create new entries from gratuitous ARPs unless arp_accept is set. No one replies, unless another host also uses 192.0.2.2.
3. Why does an ACD probe use 0.0.0.0 as the sender IP address instead of the address being tested?
Answer
If the probe used the tested address as the sender, every host that already has an entry for that address would update it to the prober's MAC address, breaking communication with the address's real owner if there is one. With 0.0.0.0, the probe asks without claiming anything, so it can't disturb any cache.
4. An attacker poisons only the victim's cache (not the gateway's) and forwards the victim's packets. Which direction of traffic passes through the attacker?
Answer
Only the victim's outgoing traffic to the gateway, and through it to the Internet. The gateway still has the correct MAC address for the victim, so replies go straight to the victim. To see both directions, the attacker must poison both caches, as in the lab.
5. How does Dynamic ARP Inspection decide that an ARP reply is forged?
Answer
On untrusted ports, the switch compares the ARP packet's sender IP and sender MAC with its table of legitimate bindings, typically learned by DHCP snooping (which client MAC got which lease, on which port), plus any static bindings. A reply claiming 192.0.2.1 is at 02:00:00:00:00:66 from a port where that binding doesn't exist is dropped and logged.
6. You add a static ARP entry for your gateway on a laptop. Six months later, the gateway is replaced and the laptop loses Internet access while everyone else is fine. Why?
Answer
The new gateway has a different MAC address, but the laptop's static entry still maps the gateway's IP to the old MAC, and static entries never expire or update. The laptop keeps sending frames to a MAC address that no longer exists. Delete or update the entry. This is why static entries are a poor general defense.
Review quiz
Test yourself on the whole link layer part: Ethernet, VLANs and aggregation, duplex and flow control, bridges and spanning tree, Wi-Fi, PPP and PPPoE, MTU and tunnels, and ARP.
Quiz: The Link Layer (TCP/IP Part 3)
Previous: ARP: How IPv4 Finds the MAC Address, the ARP Cache and the Frame Format

More in TCP/IP Course
Quiz: TCP/IP Delicate Details
Twenty-five questions on the details that catch out experienced engineers: sequence numbers for SYN and FIN, TIME_WAIT versus tcp_fin_timeout, Karn's algorithm, socket buffer doubling, even and odd ephemeral ports, IPv6 checksums and fragmentation, negative DNS caching, and capture filter traps.
Quiz: TCP/IP Interview Questions
Thirty-three networking questions of the kind asked in developer, SRE and network engineering interviews: what happens when you load a URL, TCP versus UDP, handshakes, closing and TIME_WAIT, subnetting, NAT, DNS, MTU problems, congestion, TLS and QUIC, and debugging slow or failing connections.
Quiz: TCP/IP Course Final Exam (All Parts)
The final exam for the TCP/IP course: thirty questions across all fourteen parts, from packets and addressing through Ethernet, ARP, IP, DHCP, NAT, ICMP, UDP, DNS, TCP connections, reliability, congestion control, security, QUIC and troubleshooting.
Quiz: Modern Transports and Troubleshooting (TCP/IP Part 14)
Review modern transports and troubleshooting: QUIC packets, handshakes, 0-RTT, streams and connection migration, HTTP/3, Multipath TCP, SCTP multihoming, and a layered method for diagnosing real network faults.
Discussion
Sign in to ask a question or share what you learned.