Capture to a file
Save raw packets to a PCAP file to open later in Wireshark
tcpdump -i eth0 -w /tmp/capture.pcap
- tool
- tcpdump18 commands
More tcpdump commands
-
tcpdump -r /tmp/capture.pcap -n | head -50Print packets from a saved PCAP file
-
tcpdump -i any host 10.0.0.5 -nCapture only traffic to and from one IP address
-
tcpdump -i eth0 port 443 -nCapture only HTTPS traffic on port 443
-
tcpdump -i any -n port 53Watch all DNS lookups on all interfaces
-
tcpdump -i any -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | grep 'GET /'Capture packets with data on port 80 and print the HTTP GET request lines