First, Introduction
The ARP command is used to manipulate the host's ARP buffer, which can be used to display all entries in the ARP buffer, delete the specified entry, or add a static IP address corresponding to the MAC address.
Second, the grammar
-a< host >: Displays all entries for the ARP buffer,-h< address type >: Specifies the type of address used by the ARP directive;-d< host > : Removes the ARP entry for the specified host from the ARP buffer;-D: Uses the hardware address of the specified interface;-E: Displays entries in the ARP buffer in the Linux display style;-i< interface > : Specifies the network interface to operate the ARP buffer;-s< host ><mac address >: Sets the static mapping of the IP address and MAC address of the specified host;-N: Displays the entries in the ARP buffer numerically; -V: Displays detailed ARP buffer entries, including statistics for buffer entries;-f< file: Sets the static mapping of the host's IP address to the MAC address.
Third, examples
1) View ARP cache
Arp-nv
2) Add ARP cache entry
10.1. 1.1 xx:All:: £º::
3) Delete the ARP cache entry
10.1. 10.118
4) Specify the MAC address of the reply
10.0. 0.2 eth1 Pub
Tip: When eth0 receives an IP address of 10. 0.0. 2 request, reply with eth1 MAC address
Reference: http://blog.chinaunix.net/uid-9525959-id-3318814.html
Linux ARP command