[wplug] Clearing arp cache

Poyner, Brandon bpoyner at ccac.edu
Wed Jul 14 09:29:45 EDT 2004


It's not that the Linux arp command couldn't clear all the arp cache entries, they just don't give you that option (i.e.: you could modify the source code and make it happen easily enough). I guess they figure since the arp cache times out after some 3 minutes and arp broadcasts are a continual process it's not worth the effort.  Something like this should work, though it's an ugly hack.

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

Brandon Poyner
Network Engineer II
CCAC - College Office
412-237-3086


-----Original Message-----
From: Jonathan S. Billings [mailto:billings at negate.org] 
Sent: Tuesday, July 13, 2004 11:12 PM
To: General user list
Subject: Re: [wplug] Clearing arp cache


Your class exercise doesn't work on the arp on linux, freebsd or 
solaris.  There isn't a command that deletes every arp entry on linux 
or solaris, but freebsd does allow you to delete all arp entries with 
'arp -d -a'.

On Jul 13, 2004, at 10:57 PM, Greg Simkins wrote:

> I have a class exercise that claims that the arp cache can be cleared 
> by typing
>
>   
>
> Arp -d *.*.*.*
>
>  
>
> In Redhat 9 Linux this give an error about an unknown host. 
>
>   
>
> If I type merely arp -a, I get prompted for a host name. 
>
>   
>
> In Windows,  arp -a will delete the entire cache. 
>
>   
>
> I have been reading my resources and searching online, but have not 
> found a way to clear the arp cache in Redhat Linux 9. 
>
>   
>
> Does anybody know how to do this? 
>
>   
>
> Greg Simkins
>
> Pittsburgh,  PA
>
> Phone:  412-341-7926
>
> FAX:  412-341-0790
>
> Mobile:  412-478-2892
>
>  
> _______________________________________________
> wplug mailing list
> wplug at wplug.org
> http://www.wplug.org/mailman/listinfo/wplug


_______________________________________________
wplug mailing list
wplug at wplug.org
http://www.wplug.org/mailman/listinfo/wplug




More information about the wplug mailing list