# tcpdump(1) # CLI ```markdown tcpdump [opts] -i [] -n Don't covert host/port names. -w Write pcap trace to file or stdout (-). -r Read & parse pcap file. ``` Some useful filters. ```markdown src Filter for source IP. dst Filter for destination IP. host Filter for IP (src + dst). net / Filter traffic on subnet. [src/dst] port Filter for port (optionally src/dst). tcp/udp/icmp Filter for protocol. ``` > Use `and/or/not` and `()` to build filter expressions. # Examples ## Capture packets from remote host ```makrdown # -k: Start capturing immediately. ssh tcpdump -i -w - | sudo wireshark -k -i - ```