ARP(8)
โจ NAME โจ
okay bestie, welcome to the arp manual (it's section 8, the sysadmin corner ๐
) ๐
arp - manipulate the system ARP cache
๐ SYNOPSIS ๐
arp [-vn] [-H type] [-i if] [-ae] [hostname]
arp [-v] [-i if] -d hostname [pub]
arp [-v] [-H type] [-i if] -s hostname hw_addr [temp]
arp [-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pub
arp [-v] [-H type] [-i if] -Ds hostname ifname [netmask nm] pub
arp [-vnD] [-H type] [-i if] -f [filename]
๐ฆ DESCRIPTION ๐ฆ
so arp is the tool that pokes at the kernel's IPv4 network neighbour cache ๐ง It can add entries to the table, delete one, or just show you what's currently in there.
ARP stands for Address Resolution Protocol, and it's how your machine finds the media access control address of a network neighbour when it only knows the IPv4 address. iykyk ๐ธ
๐ MODES ๐
so with no mode specifier, arp just prints the current table. You can narrow that down by giving it a hardware address type, an interface name, or a host address, so you don't have to scroll through everything ๐
arp -d address deletes an ARP table entry. You need root or netadmin privilege for this, no cap ๐ฅ The entry gets found by its IP address. If you give it a hostname, that gets resolved first, and then the entry is looked up in the ARP table.
arp -s address hw_addr sets up a brand new table entry. The format of hw_addr depends on the hardware class, but for most classes you can assume the usual presentation works. For the Ethernet class that's 6 bytes in hexadecimal, separated by colons. When you add proxy arp entries (the ones with the publish flag set), you can specify a netmask to proxy arp for entire subnets. Fair warning: this is not good practice ๐ but older kernels support it because it can be useful. If you don't supply the temp flag, the entry gets permanently stored in the ARP cache. And if you want to set up an entry for one of your own network interfaces, the arp -Ds address ifname form is the bestie move, since the hardware address gets taken straight from the interface with that name โจ
๐ OPTIONS ๐
-v,--verboseโ tells you what's going on by being verbose ๐ฃ๏ธ-n,--numericโ shows numerical addresses instead of trying to figure out symbolic host, port or user names ๐ข-H type,--hw-type type,-t typeโ when you're setting or reading the ARP cache, this optional parameter tellsarpwhich class of entries to check for. The default isether(aka hardware code0x01for IEEE 802.3 10Mbps Ethernet). Other options include network tech like ARCnet (arcnet), PROnet (pronet), AX.25 (ax25) and NET/ROM (netrom) ๐-aโ uses the alternate BSD style output format, with no fixed columns ๐-eโ uses the default Linux style output format, with fixed columns ๐-D,--use-deviceโ instead of ahw_addr, the argument you give is the name of an interface.arpwill use that interface's MAC address for the table entry. This is usually the best option for setting up a proxy ARP entry pointing at yourself ๐ฆ-i If,--device Ifโ selects an interface. When dumping the cache, only entries matching that interface get printed. When setting a permanent or temp entry, the entry gets associated with this interface. If you don't use this option, the kernel guesses based on the routing table. Forpubentries, the interface you name is the one where ARP requests get answered ๐
NOTE: this has to be different from the interface the IP datagrams will be routed to.
NOTE: as of kernel 2.2.0 it is no longer possible to set an ARP entry for an entire subnet ๐ Linux instead does automagic proxy arp when a route exists and it's forwarding. Seearp(7)for the tea. Also, thedontpuboption (available for delete and set operations) cannot be used with 2.4 and newer kernels.
-f filename,--file filenameโ similar to-s, except this time the address info comes from the filefilename. Super useful if you've got ARP entries for a whole lot of hosts to set up ๐ง The data file is very often/etc/ethers, but that's not official. If you don't specify a filename,/etc/ethersis used by default.
The file format is simple: it's just ASCII text lines with a hostname and a hardware address separated by whitespace. You can also use the pub, temp and netmask flags in there ๐ซถ
In every spot where a hostname is expected, you can also enter an IP address in dotted-decimal notation, no stress ๐
As a special case for compatibility, the order of the hostname and the hardware address can be swapped. Wild, I know ๐
Every complete entry in the ARP cache gets marked with the C flag. Permanent entries are marked with M, and published entries have the P flag โจ
๐ EXAMPLES ๐
/usr/sbin/arp -i eth0 -Ds 10.0.0.2 eth1 pub
This answers ARP requests for 10.0.0.2 on eth0 with the MAC address for eth1 ๐ฆ
/usr/sbin/arp -i eth1 -d 10.0.0.1
Deletes the ARP table entry for 10.0.0.1 on interface eth1. This will match published proxy ARP entries and permanent entries too ๐
๐๏ธ FILES ๐๏ธ
/proc/net/arp/etc/networks/etc/hosts/etc/ethers
๐ SEE ALSO ๐
ethers(5), rarp(8), route(8), ifconfig(8), netstat(8) ๐
๐ AUTHORS ๐
Fred N. van Kempen <waltje@uwalt.nl.mugnet.org>, Bernd Eckenfels <net-tools@lina.inka.de> ๐ซถ
that's the whole tea, bestie ๐ it's from net-tools, dated 2008-10-03, and you're literally a whole ARP pro now ๐ฆโจ
๐ฆ where this page comes from
- alpine 3.22: net-tools-doc 2.10-r3 ยท GPL-2.0-or-later
- alpine 3.23: net-tools-doc 2.10-r3 ยท GPL-2.0-or-later
- alpine 3.24: net-tools-doc 2.10-r3 ยท GPL-2.0-or-later
- arch rolling: net-tools 2.10-3 ยท GPL2
- debian bookworm: net-tools 2.10-0.1+deb12u2 ยท GPL-2.0-or-later
- debian trixie: net-tools 2.10-1.3 ยท GPL-2.0-or-later
- nixpkgs unstable: net-tools 2.10
- opensuse-leap 16.0: net-tools-deprecated 2.10-160000.4.1 ยท GPL-2.0-or-later
- opensuse-leap 16.0: net-tools-deprecated 2.10-160000.4.1 ยท GPL-2.0-or-later
- opensuse-leap 16.0: net-tools-deprecated 2.10-160000.4.1 ยท GPL-2.0-or-later
- opensuse-leap 16.0: net-tools-deprecated 2.10-160000.4.1 ยท GPL-2.0-or-later
- ubuntu noble: net-tools 2.10-0.1ubuntu4 ยท GPL-2.0-or-later
- ubuntu noble: net-tools 2.10-0.1ubuntu4.4 ยท GPL-2.0-or-later
- ubuntu questing: net-tools 2.10-1.3ubuntu2 ยท GPL-2.0-or-later
- ubuntu resolute: net-tools 2.10-2ubuntu1 ยท GPL-2.0-or-later
- ubuntu stonking: net-tools 2.10-2ubuntu1 ยท GPL-2.0-or-later
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms