LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   ARP flush (https://www.linuxquestions.org/questions/suse-opensuse-60/arp-flush-336090/)

abneru 06-22-2005 10:15 AM

ARP flush
 
Can I flush all my arp entries with one single command instead of doing it one by one using the arp -d command?

david_ross 06-23-2005 12:42 PM

Try using this:
for addr in `arp -n`;do arp -nd $addr;done

It will throw up some errors but it should delete all of the entries.

OS Jockey 08-12-2011 12:54 PM

Another, cleaner way...
 
for i in `awk -F ' ' '{ if ( $1 ~ /[0-9{1,3}].[0-9{1,3}].[0-9{1,3}].[0-9{1,3}]/ ) print $1 }' /proc/net/arp` ; do arp -d $i ; done

barataaway 01-27-2012 12:57 PM

Yes, you can!
 
You could do that (on RHEL, at least) by using "ip" command:

Code:

ip n flush
or

Code:

ip neigh flush
or

Code:

ip neighbour flush

By the way, the IPv4 neighbour table is known as "ARP table".


You could use -statistics option too:

Quote:

Originally Posted by man ip
With the -statistics option, the command (ip n flush) becomes verbose. It prints out the number of deleted neighbours and the number of rounds made to flush the neighbour table.

=)


All times are GMT -5. The time now is 02:57 AM.