Flush ARP Cache

arp

Command:

for e in $(arp -a | sed -n 's/.*(\([^()]*\)).*/\1/p'); do echo Remove $e; arp -d $e; done

Example:

root@fsisrv# for e in $(arp -a | sed -n 's/.*(\([^()]*\)).*/\1/p'); do echo Remove $e; arp -d $e; done
Remove 10.10.10.245
Remove 10.10.10.8
Remove 10.10.10.50
Remove 10.10.10.100

ip

Command:

ip -s -s neigh flush all

Example:

root@fsisrv# ip -s -s neigh flush all
10.10.10.245 dev eth0 lladdr 00:08:9b:f5:b4:5f used 36/31/3 probes 1 STALE
10.10.10.8 dev eth0 lladdr 00:50:56:01:01:01 used 243/243/215 probes 4 STALE
10.10.10.50 dev eth0 lladdr 00:50:56:05:01:02 ref 1 used 246/0/246 probes 4 REACHABLE
10.10.10.100 dev eth0 lladdr 14:9d:99:7f:11:cf ref 1 used 247/0/247 probes 4 REACHABLE
 
*** Round 1, deleting 4 entries ***
*** Flush is complete after 1 round ***


Authors:
  • Jochen Schnürle