Network

The arp command

Shows the ARP cache: the mapping between IP addresses on your local network and the MAC addresses of the network cards that use them. It helps you see who is on the network. It is the classic net-tools command; ip neigh is preferred today, but arp is still on many systems.

Syntax

arp [-n] [-i interfaz] -a | -d IP | -s IP MACTry it in the terminal →

Most useful options

-aShows all the cache entries
-nDoes not resolve names: shows IPs as they are
-i <interfaz>Only entries of that interface, for example wlp3s0
-d <IP>Deletes the entry for that IP. Needs root
-s <IP> <MAC>Adds a fixed entry. Needs root

Copy-ready examples

$ arp -alists the machines your computer has seen on the local network.

Example output

? (192.168.1.1) at 3c:52:82:1a:9f:10 [ether] on wlp3s0
nas.local (192.168.1.20) at 00:1b:21:3c:4d:5e [ether] on wlp3s0
$ arp -an -i wlp3s0only the wlp3s0 interface, without machine names.
$ sudo arp -d 192.168.1.50deletes the entry of a machine that changed its network card. The next time, the cache fills again.
$ ip neighthe modern equivalent from the iproute2 package: the same table, with the state of each neighbour.

Example output

192.168.1.1 dev wlp3s0 lladdr 3c:52:82:1a:9f:10 REACHABLE

You can try them in the browser terminal: it does not touch your computer.

Common errors

MessageCauseFix
SIOCDARP(priv): Operation not permittedDeleting or adding ARP entries requires administrator privileges. Without sudo, arp refuses the change.Repeat the command with sudo. To only read the table, you do not need it.

Typical mistakes

  • The cache is temporary: entries expire on their own, so an empty table does not mean the network is down.

Differences from similar commands

  • ip: with ip neigh it shows and edits the same ARP table. It is the recommended replacement for arp.
  • ping: pinging a machine fills the cache with its MAC address. Without that step, the entry may not exist.
  • route: shows the routing table: where traffic goes. arp shows which MAC answers each IP.

Security

ARP does not verify who answers, so someone on your network can poison the cache and redirect your traffic (ARP spoofing). If you see two IPs with the same MAC in arp -a, be suspicious. On small networks, arp -s can pin known entries, but the real protection lies in the switch and the firewall.

Related commands

FAQ

Why does arp -a not show a machine I know is on the network?

Because its entry is not in the cache. Ping its IP and run arp -a again.

What does <incomplete> in the table mean?

It means no MAC address was obtained for that IP because the machine did not answer. It is usually off or out of the network.

Does arp work with IPv6?

No. IPv6 uses NDP, which ip -6 neigh shows in the same table.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course