Environment
- Red Hat Enterprise Linux (All Versions)
- ARP cache
Issue
- Need to clear ARP cache, when commands like
ip -s -s neigh flush all
Orarp -d <IP-address>
are used to remove cache they leave the table with entries whereHWaddress
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>
ORip -s -s neigh flush all
will make the entries invalid showing it as(incomplete)
underHWaddress
column. Such entries anyways cannot be used and are as good as deleted entry in terms ofARP
processing because whenever system has to access any such IP, it has to do allarp
processing 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 aDEFROUTE
interface then one may get aARP
entry again in cache for system’s default gateway IP after doingifup
.