Analyze network traffic

How can I analyze network traffic?
I have RPi 3 with OSMC.
I would like a tool like peerguardian, to use from the terminal.

Best Regards

Have you tried the instructions on their website to install it/ (Use the Debian instructions)

You might want to point out the program you refer to with a link as the only peerguardian I find is a IP connection blocking tool.

To analyse network traffic on OSMC you can use tcpdump and to block IP connections you can use iptables