Sunday, January 12, 2014

clearing arp cache in linux

 Arp manipulates or displays the kernel's IPv4 network neighbour cache.
 It can add entries to the table, delete one or display the current content.


ARP  stands  for Address Resolution Protocol, which is used to find the media access control address of a network neighbour for  a  given  IPv4 Address.

Command to list the current arp entries 

root@server-82:~# arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
1.1.1.1             ether   00:0f:f8:a6:6d:40   C                     eth0
1.1.1.2             ether   08:00:27:62:cd:e9   C                     eth0
root@server-82:~#



The following command will clear all the arp cache entries.
root@server-82: ~# ip -s -s neigh flush all

 Deleting arp entries of  specific host
root@server-82~# arp -d 1.1.1.1

Assigning static arp entries for specific host
root@server-82~# arp -s 1.1.1.1  00:0f:f8:a6:6d:40 
  
This will answer ARP requests for 1.1.1.1 on eth0 with the MAC address for eth1.
 arp -i eth0 -Ds 1.1.1.1 eth1 pub



No comments :

Post a Comment