Dump full payload in hex and ASCII

Show full packet bodies in hex and ASCII, -s 0 makes sure nothing is cut off

tcpdump -nn -s 0 -X -i any port <port>

tool
tcpdump18 commands
tags
tcpdumpdebugnetworktroubleshooting

More tcpdump commands

  • tcpdump -nn -i any -s 0 -C 100 -W 5 -w /tmp/cap.pcap

    Rotate across 5 files of 100 MB each, so a long capture never fills the disk

  • tcpdump -nn -i any -G 3600 -w '/tmp/cap-%Y%m%d-%H%M%S.pcap'

    Start a new pcap file every hour with a timestamp in the name, good for unattended capture

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

    Apply a BPF filter to a saved capture without capturing again

  • 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

all 18 tcpdump commands