ARP table vs DHCP lease: device identity

ARP table vs DHCP lease: device identity

The router shows a phone you don’t recognize. The ARP table lists its address, the DHCP lease lists the same address and the same MAC, and it is tempting to call that proof. The two tables record different events at different layers, and comparing the ARP table against the DHCP lease without knowing what each one remembers is how people misidentify devices on networks they own.

Both tables happily show an IP sitting next to a MAC address, and that is where the similarity ends.

ARP table vs DHCP lease: what each one records

An ARP entry is written by the kernel of whatever host did the talking. When your machine wants to send a frame to an address on the link, it asks who owns that IP, caches the answer, and keeps it until the neighbor subsystem decides the answer has gone cold. No server approved it. No authentication guards it. Any device on the segment can answer the question, and the kernel will believe the answer until traffic contradicts it.

A DHCP lease is the opposite kind of record. It was created by the server that handed out the address, keyed by the client’s MAC, written to disk with an expiry timestamp. The server promised this IP to this hardware for this long. Whether the client is currently online is a different question, and the lease file does not care.

  • What it proves: ARP proves who answered last; a lease proves who was assigned the address, possibly hours ago.
  • Who writes it: the kernel of every host that talks on the link for ARP, one authoritative server for DHCP.
  • Lifetime: ARP entries age out in minutes under kernel garbage collection; leases run for whatever duration the pool configured, often 12 hours to several days.
  • Where to read it: ip neigh show on the router itself for ARP, the lease file or router web UI for DHCP.
  • Typical failure: a spoofed ARP answer looks identical to a legitimate one, and an expired-but-still-listed lease looks identical to an active one.

Neither row names a person. Correlation between the two is the minimum, and time decides whether the correlation means anything. An authoritative-looking wrong answer is worse than no answer at all; a site search that answered 19 of 20 queries and none of them correctly made that point here before, and a router UI selling you a device name off a stale lease is the same trap.

What the kernel actually stores in an ARP entry

Run ip neigh show on the router. You will see states most people skim past: REACHABLE, STALE, DELAY, PROBE, PERMANENT, and occasionally INCOMPLETE or FAILED. REACHABLE means the kernel has recent confirmation, either from its own traffic or from an unsolicited announcement. STALE means the confirmed mapping has aged past its reachability window and the kernel will re-probe it the next time something needs to send.

The timing explains why the table seems to forget and forgive at odd moments. Linux derives its reachability window from base_reachable_time_ms, 30000 by default, then randomizes the effective value between half and one and a half times that figure so a fleet of hosts doesn’t re-probe in lockstep. A stale entry is therefore about 30 seconds past its last confirmation on average, not hours, but the exact threshold differs per entry and per boot. State that outlives its proof is a familiar shape; three correct-looking bugs left a closed socket open for days in a recent write-up here, and a neighbor entry lingering past its evidence is that same shape with a kinder failure mode.

One habit to drop: treating PERMANENT as trusted. A permanent entry exists because someone ran ip neigh add with nud permanent, or because the interface is configured that way. It skips validation forever. On a managed router that is an inventory item; on a box anyone can touch, it is attack surface.

Reading the DHCP lease file directly

dnsmasq writes leases to /var/lib/misc/dnsmasq.leases on a default Debian install and to /tmp/dhcp.leases on a default OpenWrt install. Each line carries the expiry as a Unix timestamp, the MAC, the IP, the hostname the client claimed, and its client identifier. That timestamp is the fact most people ignore: it tells you when the assignment ends, not when the device last spoke.

# the rumor: kernel neighbor table, taken on the router itself
ip neigh show dev br-lan
# aa:bb:cc:0d:2e:41 192.168.1.34 REACHABLE
# aa:bb:cc:9f:71:03 192.168.1.77 STALE

# the promise: dnsmasq leases (Debian: /var/lib/misc/dnsmasq.leases,
# OpenWrt default: /tmp/dhcp.leases)
cat /tmp/dhcp.leases
# 1764391200 aa:bb:cc:0d:2e:41 192.168.1.34 office-laptop 01:aa:bb:cc:0d:2e:41
# 1764389800 aa:bb:cc:9f:71:03 192.168.1.77 * 01:aa:bb:cc:9f:71:03

The renewal schedule explains why a lease can look fresh while the device sleeps. RFC 2131 has the client try to renew at half the lease time, the T1 point, then fall back to rebind at 87.5 percent, the T2 point, before giving the address up. A phone that left the house an hour ago still holds its lease, still shows a hostname in the file, and its ARP entry is long gone. The reverse happens too: a device with a static address never touches DHCP, so it appears in ARP and in no lease file, and the missing lease gets read as proof the address is unassigned. Deviceshelf’s walkthrough of comparing ARP tables against DHCP leases makes the same distinction from the router UI side.

LINKMASK41

An ARP entry is a rumor the kernel repeats until traffic proves it wrong. A lease is a promise the server made whether or not the client still listens. Troubleshooting means correlating rumors with promises, and it fails the moment you promote either one to fact.

LINKMASK42

When both tables agree and the answer is still wrong

Both tables can agree and the identification can still fail, because the MAC itself stopped being a stable identity. Android 10 and later randomize the MAC per SSID by default. iOS 14 and later call the same feature Private Wi-Fi Address and enable it by default. The phone presents a different hardware address to every network it joins, so the lease and the ARP entry are consistent with each other and consistent with nothing else you know about the device.

Cloning produces the same failure from the other direction. Any laptop can set its MAC to match a whitelist entry, and plenty of smart-home gadgets ship with duplicated MACs because the vendor burned the same range into a production batch. If your router’s parental controls or access lists key on MAC, they are keyed on a value the client chooses. Treat every MAC-based control as a speed bump, not a wall.

What each disagreement means

Four mismatches cover most real cases, and each points somewhere specific. An IP in ARP with no lease means a static address, a device that answered before finishing discovery, or something answering that shouldn’t. A lease with no ARP entry means the device is powered off, firewall-blocked, or asleep with Wi-Fi in power save, and the lease simply hasn’t expired yet. A lease for a MAC that never appears in ARP across several hours on a busy segment is a paper record, usually a guest’s laptop from days ago that the lease timer hasn’t forgotten. Two different MACs answering for one IP means an address conflict at best and ARP spoofing at worst, and that one needs attention now, because a spoofed gateway entry is how traffic gets redirected through an attacker’s machine.

arpwatch catches that last case cheaply. It watches a segment, logs flip-flops when one IP switches MAC, and mails you before the latency gets noticed by someone else. On a home network it is one package and one config line. On anything shared, it should already be running.

The working procedure is short. Pull both tables from the router, not from your laptop, because your laptop’s ARP table only knows hosts it has personally spoken to. Correlate by MAC and by timestamps. Then confirm by behavior: which ports the device opens, whether it honors its claimed hostname, whether it answers the queries a real client of that type would send. If the unknown device turns out to be a container on the machine you are typing on, witr traces a port to its parent process faster than any neighbor table will.

Neither table is a guest list. One is what the network heard recently, the other is what the server promised once. If your DHCP server supports static reservations, set them for every device you own: the lease file stops being an approximation and becomes the ground truth the ARP table is only guessing at. Access lists and incident triage get simpler the moment the promise and the rumor stop being your only evidence.

Press ⌘K to search & switch themes