The arp command is used to view the ARP table or make changes to it. When executed with no arguments, the arp command displays the ARP table:
# arp Address HWtype HWaddress Flags Mask Iface 192.168.1.11 ether 30:3a:64:44:a5:02 C eth0
Sometimes you may want to manually configure the static ARP entry on Linux servers. This post includes steps on how to add a static entry into the system ARP cache.
Temporary change (modification will be lost after system reboot)
1. Add ARP entry into system ARP cache via command:
# arp -s hostname hw_addr
# arp -s 192.168.0.10 00:23:f6:7c:b9:4d
Permanent change (modification remains after system reboot)
Add 48 bit Ethernet addresses and their corresponding IP numbers into file /etc/ethers, for instance:
# echo "00:23:f6:7c:b9:4d 192.168.0.10" >> /etc/ethers
Deleting arp entry
In the event that a remote system has its network card replaced, it may be necessary to delete an entry from the ARP table. This can be accomplished by using the -d option to the arp command:
# arp -i eth0 -d 184.108.40.206
Once the address has been removed from the ARP table, there should be no need to add the new address manually. The next time the local system uses this IP address, it sends a broadcast request on the appropriate network to determine the new MAC address.