arp

Linux · Network · reference only

What it does

Shows and modifies the ARP cache, which maps IP addresses to MAC addresses of hosts on your local network.

Syntax

arp [opciones] [equipo]

Options and parameters

  • -a

    Shows all entries in BSD format.

  • -n

    Shows numeric addresses, without resolving names.

  • -d equipo

    Removes that host's entry.

  • -s equipo mac

    Adds a static entry.

  • -i interfaz

    Limits the operation to that interface.

  • -v

    Shows more detail.

Usage examples

  • arp -a

    Lists the local network hosts your machine knows.

  • arp -n

    Shows the cache with numeric IP addresses.

  • sudo arp -d 192.168.1.20

    Deletes that host's entry so it is discovered again.

  • sudo arp -s 192.168.1.20 aa:bb:cc:dd:ee:ff

    Sets a host's MAC address by hand.

Notes and common mistakes

  • It belongs to the net-tools package; the modern equivalent is ip neigh.
  • It only sees local network hosts you have already communicated with.

Related commands