arp(8)
Display and manipulate the system ARP cache, mapping IP addresses to MAC addresses on the local network.
Synopsis
arp [-vn] [-H type] [-i if] [-ae] [hostname]
arp [-v] [-i if] -s hostname hw_addr
arp [-v] [-i if] -d hostname [pub]
arp -a [hostname]
arp -n [hostname]
arp -f [filename]Description
The arp command is used to display entries in the kernel's ARP (Address Resolution Protocol) cache, which maps IPv4 addresses to hardware (MAC) addresses on the local network. ARP is essential for finding the MAC address of a host given its IP address.
By default, arp displays all known ARP entries. You can add static ARP entries, delete entries, or look up specific hosts. The command is primarily used for network troubleshooting and configuring static ARP bindings for special network scenarios.
Common options
| Flag | What it does |
|---|---|
-a | Display all ARP table entries in the default format |
-n | Show IP addresses numerically instead of resolving hostnames |
-v | Verbose output; show detailed information about ARP entries |
-i if | Select a specific network interface (e.g., eth0, wlan0) |
-d hostname | Delete an ARP entry for the specified hostname |
-s hostname hw_addr | Create a static ARP entry manually (requires root privilege) |
-f filename | Read hostname-MAC address pairs from a file and add them |
-H type | Specify hardware address type (ether for Ethernet, default) |
-e | Display entries in BSD format with column headers |
Examples
Display all ARP cache entries with hostnames
arp -aShow all ARP entries with IP addresses in numeric format instead of names
arp -nLook up a specific IP address in the ARP cache
arp -an | grep 192.168.1.100Add a static ARP entry binding IP 192.168.1.50 to MAC address aa:bb:cc:dd:ee:ff
sudo arp -s 192.168.1.50 aa:bb:cc:dd:ee:ffRemove a static ARP entry for the specified IP address
sudo arp -d 192.168.1.50Display ARP cache entries only for the eth0 network interface
arp -i eth0 -anShow verbose ARP output with numeric IP addresses and extra details
arp -vnRead ARP entries from /etc/ethers file and add them to the cache
sudo arp -f /etc/ethers