How to tcpdump to a file

I use this quite frequently when trying to monitor network traffic to a host. This will save all of the traffic for a host to a file. The file can then be viewed with Ethereal (or some other tool)

tcpdump -n -i any -w /var/tmp/SOMEFILE -p -C 100 -W 10 -s 1500 host SOMEIP

This will make files up to 100 MB in size and keep up to 10 ‘rotations’ of it. Of course, you can use other parameters besides just the ‘host’ parameter to match whatever traffic it is that you want.

Leave a Reply

Your email address will not be published. Required fields are marked *