Environment

  • Red Hat Enterprise Linux (All Versions)
  • ARP cache

Issue

  • Need to clear ARP cache, when commands like ip -s -s neigh flush all Or arp -d <IP-address> are used to remove cache they leave the table with entries where HWaddress is marked as (incomplete) but the entry still remains there.
  • How to completely remove the arp entry from table OR make the table empty ?

Resolution

  • If the expectation is to completely empty the arp cache table such that it will not display anything, then there is NO direct way to do that before the respective timer expires.
  • The command to flush / remove the ARP cache like arp -d <IP-address> OR ip -s -s neigh flush all will make the entries invalid showing it as (incomplete) under HWaddress column. Such entries anyways cannot be used and are as good as deleted entry in terms of ARP processing because whenever system has to access any such IP, it has to do all arp processing as in new IP / something which is not there in cache, etc.
  • One way to completely empty the table is to bring down the respective interface and bring it UP again (ifdown/ifup) but its not considered as a feasible way. Even after doing this, if the system’s interface is configured to get IP via DHCP (BOOTPROTO=dhcp) and is also a DEFROUTEinterface then one may get a ARP entry again in cache for system’s default gateway IP after doing ifup.