Read data traffic on Raspberry?

I have a hotspot on my Raspberry Pi and would like to read the data traffic of a connected device (192.168.4.13). I also have the MAC address. I've tried absolutely everything and can't seem to write this simple JS script that prints the data (rx and tx) to the console in MB/s. Does anyone know of a tool for this? Thanks in advance!

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
11 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Thomasg
2 months ago

with the iptraf you can display all connections and the bandwidth you use.

or create a iptables rule in the mangle table for the IP address and then display the total traffic since creating the rule. If you call this regularly, you could calculate the bandwidth you use with some Grep and some calculation.

Thomasg
2 months ago
Reply to  radfl

absolute overkill solution would be this: https://www.ntop.org/products/traffic-analysis/ntop/

What do you mean with js?

Thomasg
2 months ago

does not have anything to do with my answers and simply reads out the entire network traffic of the wlan interface, but okay if it suits you.
So this: https://pastebin.com/2JUS6R3G

Thomasg
2 months ago

very beautiful, iptraf is of course the simplest, ntop is more complicated and is intended for a long-term and detailed analysis of network traffic.

Thomasg
2 months ago

what do you want with javascript on a Linux Console? Most smaller script stuff you can do with bash and the existing GNU tools and for more complex, more extensive things I take python.