Time-rotated capture files tcpdump
Start a fresh pcap every hour with a timestamped name for unattended capture
tcpdump -nn -i any -G 3600 -w '/tmp/cap-%Y%m%d-%H%M%S.pcap'
more tcpdump
all 18 commands →
Filter an existing pcap offline
tcpdump -nn -r /tmp/cap.pcap 'port 443 and host <ip>'
DNS query capture with link header
tcpdump -nn -e -i any port 53
Capture on interface
tcpdump -i eth0 -n
Capture to file
tcpdump -i eth0 -w /tmp/capture.pcap
Read PCAP file
tcpdump -r /tmp/capture.pcap -n | head -50