Filter a saved pcap offline

Apply a BPF filter to a saved capture without capturing again

tcpdump -nn -r /tmp/cap.pcap 'port 443 and host <ip>'

tool
tcpdump18 commands
tags
tcpdumpdebugtlstroubleshooting

More tcpdump commands

  • tcpdump -nn -e -i any port 53

    Show DNS lookups with MAC addresses (-e) to see which LAN client sent each query

  • tcpdump -i eth0 -n

    Capture all traffic on eth0 without resolving names

  • tcpdump -i eth0 -w /tmp/capture.pcap

    Save raw packets to a PCAP file to open later in Wireshark

  • tcpdump -r /tmp/capture.pcap -n | head -50

    Print packets from a saved PCAP file

  • tcpdump -i any host 10.0.0.5 -n

    Capture only traffic to and from one IP address

all 18 tcpdump commands