How it works...

We used the tcpdump Linux tool, which is used to capture or filter data packets. tcpdump is used to capture a packet on a specific interface. We used the -i option for this. We can save captured packets in a file. Just give the filename and specify the -w option in the tcpdump command. We can read the file by giving the -r option to read the file in the tcpdump command.

Get Bash Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.