From wikistone
TCPDump
Monitor all traffic on port 25:
- -vv : More verbose output
- -x : When parsing and printing, in addition to printing the headers of each packet, print the data of each packet.
- -X : When parsing and printing, in addition to printing the headers of each packet, print the data of each packet (minus its link level header) in hex and ASCII. This is very handy for analysing new protocols.
- -s : 0: Snarf up to snaplen bytes of data from each packet rather than the default of 68, 0 is no size limit. This is useful to see lots of information.
- -i : eth1 : Monitor eth1 interface
- -C : pcap files rotate every n size in MB
- -G : pcap files rotate every n sec
- -W : rotate n files
- -K : don't verify checksums
- src [net] : source host / network(CIDR)
- dst [net] : destination host / network(CIDR)
- net : network(CIDR) (will filter src or dest)
Text Dump
tcpdump -vv -X -s 1500 -i eth1 port 25
File Dump
tcpdump -i [interface] -s 0 -K -w [file] net a.b.c.d/24