$linuxjunkies
>

arp(8)

Display and manipulate the system ARP cache, mapping IP addresses to MAC addresses on the local network.

UbuntuDebianFedoraArch

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

FlagWhat it does
-aDisplay all ARP table entries in the default format
-nShow IP addresses numerically instead of resolving hostnames
-vVerbose output; show detailed information about ARP entries
-i ifSelect a specific network interface (e.g., eth0, wlan0)
-d hostnameDelete an ARP entry for the specified hostname
-s hostname hw_addrCreate a static ARP entry manually (requires root privilege)
-f filenameRead hostname-MAC address pairs from a file and add them
-H typeSpecify hardware address type (ether for Ethernet, default)
-eDisplay entries in BSD format with column headers

Examples

Display all ARP cache entries with hostnames

arp -a

Show all ARP entries with IP addresses in numeric format instead of names

arp -n

Look up a specific IP address in the ARP cache

arp -an | grep 192.168.1.100

Add 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:ff

Remove a static ARP entry for the specified IP address

sudo arp -d 192.168.1.50

Display ARP cache entries only for the eth0 network interface

arp -i eth0 -an

Show verbose ARP output with numeric IP addresses and extra details

arp -vn

Read ARP entries from /etc/ethers file and add them to the cache

sudo arp -f /etc/ethers

Related commands