From the man page: tcpdump - dump traffic on a network
Basic use cases would be:
sudo tcpdump -t -A -s0 src host 10.101.1.25 -i eth0
-t
: Doesn’t show any timestamp.-A
: Show the packet data in ASCII-s0
: Will show the the whole packet(headers and body)-i
: Listen to data on given interfaces.
tcpdump -D
or tcpdump--list-interfaces
orip link show
ornetstat -i
sudo tcpdump -t -s0 src net 10.101.0.0/16 -i eth0
22
port:
sudo tcpdump -t -A -s0 port 22 -i eth0
sudo tcpdump -t -A -s0 src port 22 -i eth0
80
portsudo tcpdump -t -A -s0 dst port 80 -i wlan0
tcpdump -n "dst host 10.1.1.2 and dst port 80" -i wlan0
sudo tcpdump -t -A -s0 src net 10.101.0.0/16 -i eth0 -v -w packets.cap
tcpdump -r packets.cap
Advanced:
Reference: