Capture to file tcpdump
Save raw packets to PCAP file for Wireshark analysis
tcpdump -i eth0 -w /tmp/capture.pcap
more tcpdump
all 18 commands →
Read PCAP file
tcpdump -r /tmp/capture.pcap -n | head -50
Filter by host
tcpdump -i any host 10.0.0.5 -n
Filter by port
tcpdump -i eth0 port 443 -n
Capture DNS queries
tcpdump -i any -n port 53
Show HTTP GET requests
tcpdump -i any -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | grep 'GET /'