Environment
- Red Hat Enterprise Linux (All Versions)
- ARP cache
Issue
- Need to clear ARP cache, when commands like
ip -s -s neigh flush allOrarp -d <IP-address>are used to remove cache they leave the table with entries whereHWaddressis marked as(incomplete)but the entry still remains there. - How to completely remove the
arpentry from table OR make the table empty ?
Resolution
- If the expectation is to completely empty the
arpcache 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>ORip -s -s neigh flush allwill make the entries invalid showing it as(incomplete)underHWaddresscolumn. Such entries anyways cannot be used and are as good as deleted entry in terms ofARPprocessing because whenever system has to access any such IP, it has to do allarpprocessing as in newIP/ 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 viaDHCP(BOOTPROTO=dhcp) and is also aDEFROUTEinterface then one may get aARPentry again in cache for system’s default gateway IP after doingifup.