LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Suse/Novell
User Name
Password
Suse/Novell This Forum is for the discussion of Suse Linux.

Notices

Reply
 
Search this Thread
Old 06-22-2005, 10:15 AM   #1
abneru
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
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
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
barataaway
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:

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.
=)
 
  


Reply


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


All times are GMT -5. The time now is 03:55 PM.

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