ARP cache

ARP cache

The arp table or arp cache keeps track of all devices on your network that your computer is capable of communicating with. It stores the Layer 2 data ( MAC addresses ) as well as the interface in which the device is connected through (i.e. which interface the traffic came in on ). This table can be viewed, modified, flushed using the arp command in Linux

View Arp Cache Entries

arp -n

The output will something like the following.

Address                  HWtype  HWaddress           Flags Mask            Iface 
22.23.24.25             ether   00:22:aa:63:88:3f   C                     eth0

Add Static Arp Entry

To add an arp entry we can use the following arp command.

arp -i eth0 -s 10.10.10.13 de:aa:bb:ef:fe:eg

Remove Entry From Arp Cache

To remove an entry we can use the below command

 arp -i <if>] -d  <host>

Some example usages are given below

 arp -i eth0 -d 10.11.12.13
 arp -d 192.168.1.100

Flush all arp cache entries

 ip neigh flush all --> Flush all arp entires
 ip -s -s neigh flush all --> For verbose output 
 ip neigh flush 10.0.1.13 --> Flush arp entry for host 10.0.1.13

 

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: