clearing the arp cache in linux

You can clear the arp cache using following commands:

Current arp cache
root@server [~]# arp -n
Address HWtype HWaddress Flags Mask Iface
70.167.140.1 ether 00:00:0C:9F:F0:04 C eth0

 
Clearing arp cache with verbose
root@server [~]# ip -s -s neigh flush all
70.167.140.1 dev eth0 lladdr 00:00:0c:9f:f0:04 ref 42 used 17/0/65 REACHABLE
*** Round 1, deleting 1 entries ***
70.167.140.1 dev eth0 ref 42 used 0/0/0 INCOMPLETE
*** Round 2, deleting 1 entries ***
*** Flush is complete after 2 rounds ***

 
Current entries
root@server [~]# arp -n
Address HWtype HWaddress Flags Mask Iface
69.167.140.1 ether 00:00:0C:9F:F0:04 C eth0

You can also delete specific arp entries using the two following command
root@server [~]# arp -d 192.168.1.1
root@server [~]# arp -d 192.168.1.2

 
Add a static arp entry

root@server [~]# arp -s 192.168.1.10 00:00:93:12:04:57

tested on CentOS release 5.7 (Final)

g33kadmin

I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....