Skip to main content

TCP Dump

Dump network traffic / packet

List interface

tcpdump { -D | --list-interfaces }

Dump traffic

tcpdump [<option>] [<expression>]
OptionDescription
-i {<interface>|any}Listen on interface
Default: lowest numbered of interface list
-nNot resolve hostname
-nnNot resolve hostname or port
-vVerbose
-w <file.pcap>Write to file

Expression

Reference

ExpressionDescription
[src|dst] {host|ip} [not] <host>Match <host>
{host|ip} <host> and <host>Match traffic between <host> and <host>
[src|dst] net <IP address>[/<prefix length>]Match IP
<IP address><#>[.<#>[.<#>[.<#>]]]
[src|dst] port <port>Port
[src|dst] portrange <port>-<port>Port range
{tcp|udp|icmp}TCP / UDP / ICMP
vlan [VLAN ID]VLAN
Default: all IEEE 802.1Q packet
{not|!} <expression>not
<expression> { and | && } <expression>and
<expression> { or | || } <expression>or