Solved

Flushing the arp table

Posted on 2000-03-22
7
15,080 Views
Last Modified: 2010-05-18
How do you flush the arp table.  Do you have to do it one entry at a time, or can you just ditch the whole thing at once?

Thanks,
Bret
0
Comment
Question by:badreece
7 Comments
 
LVL 1

Expert Comment

by:bhagawatula
ID: 2646216
What OS?
On HPUX and Solaris :
try route -f
to flush the table.
I think you need to add your default route again after this.

-f Flush the routing tables of all  gateway  entries.
    If  this  is  used  in conjunction with one of the     commands described above, route  flushes the gate-ways before performing the command.  

0
 

Expert Comment

by:thacsi
ID: 2646648
arp -d hostname

You could build a wrapper script to first get all hostnames with arp -a and then remove them with arp -d.

0
 
LVL 1

Expert Comment

by:dserna
ID: 2646686
What Unix are we talking about here? If you are interested to know on how to flush the arp table in Solaris, this is the way you would do it:

as root:

: root@ns:/export/home/dserna2: arp -a
Net to Media Table
Device   IP Address               Mask      Flags   Phys Addr
------ -------------------- --------------- ----- ---------------
le0    209.220.74.1         255.255.255.255       00:10:67:00:3f:80
le0    ns                   255.255.255.255 SP    08:00:20:75:e9:29
le0    BASE-ADDRESS.MCAST.NET 240.0.0.0       SM    01:00:5e:00:00:00
: root@ns:/export/home/dserna2: ifconfig -a
lo0: flags=849<UP,LOOPBACK,RUNNING,MULTICAST> mtu 8232
    inet 127.0.0.1 netmask ff000000
le0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
    inet 209.220.74.121 netmask ffffff00 broadcast 209.220.74.255
    ether 8:0:20:75:e9:29
: root@ns:/export/home/dserna2: ifconfig le0 209.220.74.121 ; arp -a
Net to Media Table
Device   IP Address               Mask      Flags   Phys Addr
------ -------------------- --------------- ----- ---------------
le0    ns                   255.255.255.255 SP    08:00:20:75:e9:29
le0    BASE-ADDRESS.MCAST.NET 240.0.0.0       SM    01:00:5e:00:00:00
: root@ns:/export/home/dserna2:



I don't know about other Unix versions. Hope that helps.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Expert Comment

by:festive
ID: 2647784
regardless of what version the following could be adapted:
 below should work for solaris on le0 interface

for arpent in `arp -a | grep "^le0" ` ; do
     arp -d $arpent
done

you could specify multiple/all interfaces by substituting grep with egrep and using the following:
egrep "^le0|^hme0|^net0"

etc...

0
 
LVL 2

Expert Comment

by:festive
ID: 2647792
regardless of what version the following could be adapted:
 below should work for solaris on le0 interface

for arpent in `arp -a | grep "^le0" | awk ''{ print $2 }' ` ; do
     arp -d $arpent
done

you could specify multiple/all interfaces by substituting grep with egrep and using the following:
egrep "^le0|^hme0|^net0"

etc...

0
 
LVL 2

Accepted Solution

by:
festive earned 50 total points
ID: 2647797
regardless of what version the following could be adapted:
 below should work for solaris on le0 interface

for arpent in `arp -a | grep "^le0" | awk ''{ print $2 }' ` ; do
     arp -d $arpent
done

you could specify multiple/all interfaces by substituting grep with egrep and us
ing the following:
egrep "^le0|^hme0|^net0"

etc...
0
 

Author Comment

by:badreece
ID: 2649648
That's going to work for me.
Thanks,
Bret
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now