Capture Traffic By An IP Address Or A Network
tcpdump can filter out traffic based on IP address, and a Network, examples below.
Capture Traffic by an IP Address
To capture traffic for an IP address, we can simply use
$ sudo tcpdump host 188.8.131.52
This will capture both outgoing, and incoming traffic for an IP address,
184.108.40.206 in example above.
Capture Traffic from one direction
If you only want to capture traffic from one direction, we can use
$ sudo tcpdump src 220.127.116.11 $ sudo tcpdump dst 18.104.22.168
Capture Traffic by a Network
To capture traffic from a network or subnet, we can use
$ sudo tcpdump net 22.214.171.124/24