View address resolution cache using the IP NEIGHBORHOOD command in Linux

Home > Search > Linux commands
  by

The ip neighborhood command can be used to view the arp cache. In this example, there are a few records with the IP address, MAC address, and state of known hosts.

[root@server1 ~]# ip neighborhood
192.168.0.101 dev eth0 lladdr 00:25:b4:cf:3e:81 REACHABLE
192.168.0.102 dev eth0 lladdr 00:25:b4:de:4a:25 STALE
192.168.0.103 dev eth0 lladdr 00:25:b4:a1:37:b4 DELAY

 

  • REACHABLE = The IP address to MAC address resolution is valid.
  • STALE = The IP address to MAC address resolution is valid but probalby unreachable. 
  • DELAY = The IP address to MAC address resolution is not valid.

 

The ip neighborhood can be shortened to just ip n.

[root@server1 ~]# ip n
192.168.0.101 dev eth0 lladdr 00:25:b4:cf:3e:81 REACHABLE
192.168.0.102 dev eth0 lladdr 00:25:b4:de:4a:25 STALE
192.168.0.103 dev eth0 lladdr 00:25:b4:a1:37:b4 DELAY

 


Adding records

The ip neighborhood add command can be used to add a record to the ARP cache.

[root@server1 ~]# ip neighborhood add 192.168.0.104 lladdr 00:25:b4:b2:25:c1 dev eth0 nud permanent

 

Notice the last field in "permanent". Possible options are:

  • permanent
  • noarp
  • stale
  • reachable

 


Deleting records

The ip neighborhood del command can be used to delete a record from the ARP cache.

[root@server1 ~]# ip neighborhood del 192.168.0.104 dev eth0

 


Modify record

The ip neighborhood chg command can be used to modify a records in the ARP cache. For example, to change the state from stale to reachable:

[root@server1 ~]# ip neighborhood chg 192.168.0.102 dev eth0 nud reachable

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments