Section: Misc. Reference Manual Pages (pj)
Updated: 4 July 2005
Return to Main Contents
So the man page has pretty much all you need, but here are the most useful options:
- -i interface
Sets the interface to listen on, e.g. eth0 or wlan0. Defaults to eth0.
- -s n
Sets the size of packets. If you say "-s 0," tcpdump will grab the entire packet.
Print the packet data in hex and ascii. (x = hex, X = ascii)
- -w f
Write the packets to file f. You can say "-w myfile -w -" to get a "tee" effect.
- -r f
Read the packets from file f.
Don't use promiscuous mode. This can simplify your rules to avoid noise and also may let you run this without root privileges (not sure about that though).
For an expression, your probably want something like this:
You can limit the noise to just one protocol like this:
'host remote.site.com && port 80'
You can limit direction like this:
'dst host remote.site.com && port 80'
'host remote.site.com dst && port 80'
You can combine expressions with not, and, or, and parentheses. You can pass the expression as several arguments or a single argument, so for complex expressions with parens you may want to just quote the whole thing.
Here's a full example:
tcpdump -s 0 -xX -w http -w - 'host hendrix && port 910'
Copyright © 2005 Paul Jungwirth
This document was created by
using the manual pages.
Time: 17:54:00 GMT, November 10, 2017