Solved

Flushing the arp table

Posted on 2000-03-22
7
15,024 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
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.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

747 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

8 Experts available now in Live!

Get 1:1 Help Now