tcpdump is the command-line packet capture tool on Linux, macOS and BSD. BPF filters let you capture exactly the traffic you care about and nothing else.
| No. | Step | Source | Destination | Type | Info |
|---|---|---|---|---|---|
| 1 | Capture | client 10.0.0.8 | DNS server 10.0.0.2 | REQUEST | A? example.com |
| 2 | Capture | DNS server 10.0.0.2 | tcpdump -ni eth0 | DATA | copy of each packet |
tcpdump is the command-line packet capture tool on Linux, macOS and BSD. BPF filters let you capture exactly the traffic you care about and nothing else.
-i picks the interface, -n skips name lookups, -w file.pcap saves for Wireshark.host 10.0.0.5 and tcp port 443, not port 22.-A prints payloads as ASCII, handy for spotting cleartext protocols.