
Tcpdump -i interface src 10.5.2.3 and dst port 3389 Capture traffic from a host that isn’t on a specific port Tcpdump portrange 21-23 Capture traffic based on packet sizeĬapture traffic from source IP and destined for a specific port $ tcpdump -i interface src 192.168.0.10 or src 192.168.0.10 Capture the traffic for port range Tcpdump -i interface port 22 or port 53 Capture the traffic on multiple hosts Tcpdump -i interface UDP Capture the traffic on multiple ports Tcpdump -i interface ssh or dhcp Capture the traffic for UDP Tcpdump -i any Capture the traffic for multiple protocols Timeout 5400 tcpdump -i eth0 'port 8080' -w myfile Capture the traffic on all interfaces Tcpdump -G 15 -W 1 -w myfile -i eth0 'port 8080'

Capture the traffic based on time intervalĬombine -G (limit # of dump files) Pcap files can be read and parsed with popular GUI based network tool Wireshark. This tutorial will show us how to isolate traffic with 20 advanced tcpdump examples-source IP, multiple interfaces, tcpdump all interfaces, multiple protocols, UDP, multiple ports, multiple hosts, tcp flags, port, port range.Ĭaptured data with different tcpdump options are generally written into a file with pcap extension.

Tcpdump command is very powerful to capture network packets with different tcpdump filters on Linux.
