ARP (Address Resolution Protocol) maps IP addresses to MAC addresses on a local network. The arp command lets you view and manage the ARP cache — the table your OS keeps of IP-to-MAC mappings it has already resolved.
When your computer wants to send a packet to an IP on the same subnet, it needs the MAC address to construct the Ethernet frame. It broadcasts an ARP Request — "Who has 192.168.1.1? Tell me." — and the owner replies with its MAC address.
ARP is the glue between Layer 3 (IP) and Layer 2 (Ethernet). Without it, packets could never leave your local segment.
Responses are stored in the ARP cache for a few minutes to avoid repeated broadcasts. The arp command lets you view, add, and remove entries in this cache.
| State | Meaning |
|---|---|
| REACHABLE | Entry is fresh and confirmed reachable |
| STALE | Entry exists but has not been confirmed recently — will be re-checked on next use |
| DELAY | Waiting to confirm the entry is still valid |
| PROBE | Actively sending ARP probes to verify the host |
| FAILED | Host did not respond — entry is invalid |
| INCOMPLETE | ARP request was sent but no reply received yet |
arping is a separate tool that sends ARP requests directly, letting you check if an IP is in use on the local segment without relying on ICMP.
| Command | Flag | Description |
|---|---|---|
| arp (Linux/macOS) | -a | Show all ARP entries (BSD style) |
| arp (Linux/macOS) | -n | Show numeric IPs — skip hostname resolution |
| arp (Linux/macOS) | -s <ip> <mac> | Add a static entry |
| arp (Linux/macOS) | -d <ip> | Delete an entry |
| arp (Windows) | -a | Display all entries for all interfaces |
| arp (Windows) | -a <ip> | Display entry for a specific IP |
| arp (Windows) | -s <ip> <mac> | Add a static entry |
| arp (Windows) | -d <ip> | Delete an entry |
| ip neigh (Linux) | show | Display the neighbour / ARP table |
| ip neigh (Linux) | flush all | Clear the entire ARP cache |
| Problem | ARP command | What to check |
|---|---|---|
| Can't reach a host on the same subnet | ip neigh show | If the entry is FAILED or missing, the host is unreachable at Layer 2 — check the cable or switch port |
| IP address conflict | arping -c 3 <ip> | If two different MACs reply, two devices share the same IP — one must be reconfigured |
| Gateway unreachable | arp -n | grep <gateway> | If the gateway has no ARP entry, your host can't send packets off the subnet |
| Suspected ARP spoofing | arp -a | If the gateway IP maps to an unexpected MAC, a device may be performing ARP poisoning |
| STALE entries causing drops | ip neigh flush all | Flush the cache to force fresh ARP resolution — helps after a device changes its IP or MAC |
