the ARP command is primarily used to display and modify the Address Resolution Protocol (ARP) used by the IP address to the Ethernet MAC (Ethernet Physical Address) conversion table.
ARP syntax format:
ARP [-EVN] [-H type] [-I if]-a [hostname]arp [-v] [-i if]-d [hostname] [pub]arp [-v] [-H type] [-i]-s hostname hw_ad Dr [Temp]arp [-v] [-H type] [-i if]-s hostname hw_addr [netmask nm] pubarp [-v] [-H type] [i if]-ds hostname IFA [NETMA SK NM] pubarp [-VND] [-H type] [-i]-f [filename]
Parameter description:
-a [hostname] or--display [hostname]: Displays all current ARP entries for the specified host. When hostname is not specified, all ARP entries are displayed. These ARP entries are shown in BSD style. -d [hostname] or--display [hostname]: Deletes the ARP entry for the specified host (requires root permission). -D or--use-device : Use the IFA hardware address interface-E: Shown in the default Linux style. -H type or--hw-type type or-t type: When setting up and querying the ARP cache, this parameter specifies that the type address be checked. The optional options for this parameter include ether, Arcnet, pronet, ax25, Netrom, and the default value is ether. -I If or--device if: Select an interface. -s hostname hw_addr or--set hostname: Manually append an ARP entry to the hostname variable to specify the host's ARP table. -f [filename] or--file [filename]: reads the ARP entry into the ARP table from the file being developed. The format of the options in this file is hostname eth_addr. -N: Displayed as a digital address. -V: Displays detailed information about the command execution process.
Example:
$ arp-a 192.168.1.1 # #显示IP为192 ARP entry for the 168.1.1 host? (192.168.1.1) at 1c:fa:68:91:f7:33 [ether] on eth0$ arp-s 192.168.1.22 00:11:22:33:44:55 # # Add an entry to the ARP mapping table $ arp-a # All ARP entries are displayed. (192.168.1.1) at 1c:fa:68:91:f7:34 [ether] on eth0? (192.168.1.22) at 00:11:22:33:44:55 [ether] PERM on eth0$ arp-d 192.168.1.22 # #删除一个arp表项 $ arp-a? (192.168.1.1) at 1c:fa:68:91:f7:34 [ether] on eth0? (192.168.1.22) at <incomplete> on eth0## check results found only removed hardware address
ARP for the Linux command