Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
SUSE / openSUSE This Forum is for the discussion of Suse Linux.


  Search this Thread
Old 06-22-2005, 10:15 AM   #1
LQ Newbie
Registered: Jun 2005
Distribution: SuSE
Posts: 10

Rep: Reputation: 0
Post 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?
Old 06-23-2005, 12:42 PM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
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.
1 members found this post helpful.
Old 08-12-2011, 12:54 PM   #3
OS Jockey
LQ Newbie
Registered: Apr 2008
Location: San Jose, CA.
Distribution: CentOS
Posts: 10

Rep: Reputation: 1
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
1 members found this post helpful.
Old 01-27-2012, 12:57 PM   #4
LQ Newbie
Registered: Jan 2012
Location: São Paulo / SP / Brazil
Distribution: Red Hat, Fedora, SuSe, HPUX, Solaris
Posts: 11

Rep: Reputation: Disabled
Lightbulb Yes, you can!

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

ip n flush

ip neigh flush

ip neighbour flush

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

You could use -statistics option too:

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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange ARP behavior : A linux server responds to all ARP requests Hdvd21 Linux - Networking 4 10-24-2013 05:02 AM
flush() before use... Elric of Grans Programming 1 07-12-2005 07:54 PM
Disabling ARP probes after receiving an ARP request AltecLansingMan Linux - Networking 1 03-30-2004 01:25 PM
How to create an proxyarp entry in arp table by using arp command? himalayas Linux - Networking 0 06-04-2003 04:14 AM
C flush() question ...... purpleburple Programming 3 11-15-2002 09:27 AM > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 08:22 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration