Capture traffic on a port with tcpdump

Sniff packets on any interface with a BPF filter — the fastest way to prove whether traffic is even reaching your server.

LinuxcapturepcaptcpdumpMedium risk
Run `sudo tcpdump -i any -nn port 443` to watch HTTPS traffic on every interface with raw IPs and ports (no DNS lookups).

01Command

Command
$ sudo tcpdump -i any -nn port 443

02What it does

`-i any` captures on all interfaces at once, which matters on multi-NIC servers and containers where guessing the interface wastes time. `-nn` disables name resolution so output stays fast and shows the true ports; without it, tcpdump resolves every IP and you lose visibility on load. Refine the filter with standard BPF syntax — `port 443 and host 10.0.0.5` — and add `-w /tmp/dump.pcap` to save a file for Wireshark instead of reading it live.

03Risk

RiskMedium risk
Requirementstcpdump installed; root (or CAP_NET_RAW) for capture
!Warning: Captured output can contain sensitive payload data; anyone watching the terminal or the pcap file sees it. Stop capture with Ctrl+C and delete pcaps when done.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-17 · Category: Network