I have a network with several Hosts N1, N2, N3, ... and they all communicate with each other. I'm in the N2 host CLI with linux. Can you know how much traffic was in bytes between a N2 Host and N3 in a period of time? In this case, total traffic and not speed of communication.
iptables -N INET_IN iptables -A INPUT -j INET_IN iptables -A INET_IN -s 192.168.1.2
I send a file with NetCat of the Host 1.
#100MB File dd if=/dev/urandom of=ffile.txt bs=1048576 count=100 cat ffile.txt | nc 192.168.1.30 1001
In Host 2.
nc -l -p 1001 > /tmp/x.x
View the result:
Chain INET_IN (1 references) pkts bytes target prot opt in out source destination 2575 105M all -- * * 192.168.1.2 0.0.0.0/0
And can use this command to flush results
iptables -Z INET_IN