Solved

Flushing the arp table

Posted on 2000-03-22
7
15,397 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
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.

705 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