Welcome to the most active Linux Forum on the web.
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, 11: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, 01:42 PM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 65
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, 01: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, 01: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 06:02 AM
flush() before use... Elric of Grans Programming 1 07-12-2005 08:54 PM
Disabling ARP probes after receiving an ARP request AltecLansingMan Linux - Networking 1 03-30-2004 02:25 PM
How to create an proxyarp entry in arp table by using arp command? himalayas Linux - Networking 0 06-04-2003 05:14 AM
C flush() question ...... purpleburple Programming 3 11-15-2002 10:27 AM

All times are GMT -5. The time now is 07:17 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