Original oneliner
ip link set arp off dev eth0 ; ip link set arp on dev eth0
Be sure to do it all at once, so you don't break network connectivity before you're able to turn ARP back on.
Alternate (safer) oneliner:
ip neigh flush all [dev <device>]
Interface discovering copy-paste command
interfaces=$(
arp -n | awk '
NR == 1 {next}
{interfaces[$5]+=1}
END {for (interface in interfaces){print(interface)}}
'
);
for interface in $interfaces; do
echo "Clearing ARP cache for $interface";
sudo ip link set arp off dev $interface;
sudo ip link set arp on dev $interface;
done
Note: The semicolons allow you to condense this command into a oneliner, but it looks terrible in a code block on SO.
Example output on Raspbian
pi@raspberrypi:~ $ arp -n
Address HWtype HWaddress Flags Mask Iface
10.0.0.1 ether 58:19:f8:0d:57:aa C wlan0
10.0.0.159 ether 88:e9:fe:84:82:c8 C wlan0
pi@raspberrypi:~ $ interfaces=$( arp -n | awk ' NR == 1 {next} {interfaces[$5]+=1} END {for (interface in interfaces){print(interface)}} '); for interface in $interfaces; do echo "Clearing ARP cache for $interface"; sudo ip link set arp off dev $interface; sudo ip link set arp on dev $interface; done
Clearing ARP cache for wlan0
pi@raspberrypi:~ $ arp -n
Address HWtype HWaddress Flags Mask Iface
10.0.0.159 ether 88:e9:fe:84:82:c8 C wlan0