Arp for linux commands and arp for linux commands
Arp commands are used to display and modify IP addresses used by the Address Resolution Protocol (ARP) 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 if] -s hostname hw_addr [temp]arp [-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pubarp [-v] [-H type] [-i if] -Ds hostname ifa [netmask nm] pubarp [-vnD] [-H type] [-i if] -f [filename]
Parameter description:
-A [hostname] Or -- display [hostname]: displays all the current ARP entries of the specified host. If no hostname is specified, all ARP entries are displayed. These ARP entries are displayed in BSD format. -D [hostname] Or -- display [hostname]: Delete the ARP entry of the host specified by hostname (root permission required ). -D or -- use-device: use the ifa hardware address interface-e: display in the default Linux style. -H type or -- hw-type or-t type: this parameter specifies to check the type address When configuring and querying arp cache. The optional parameters include ether, arcnet, pronet, ax25, and netrom. 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 ARP table of the specified host in the hostname variable. -F [filename] Or -- file [filename]: reads ARP entries from the specified file to the arp table. The format of the option 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 # Is the arp entry of the host whose IP address is 192.168.1.1 displayed? (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 ing table $ arp-a ## show all arp entries .? (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 # delete an arp table entry $ arp-? (192.168.1.1) at 1c: fa: 68: 91: f7: 34 [ether] on eth0? (192.168.1.22) at <incomplete> on eth0 # check results show that only the hardware address is deleted.