iptables –t mangle –I PREROUTING –i <INTERNAL_IF> -–source <EMPLOYEE_PC> -p tcp --dport <WATCH_PROTO> iptables –t mangle –I FORWARD –i <EXTERNAL_IF> -–destination <EMPLOYEE_PC> -p tcp -–sport <WATCH_PROTO>
Of course you can make more general rules, but that is up too you. Too many rules bogs down slow firewalls.
Look at iptables –t mangle –nvxL
The second column, bytes will be the number of bytes passed through to that user / protocol. Mind you, these counters do wrap, so if you are counting on stats that are accurate, you will have to use a tool to store these values and know how to handle wraps in the counter. I use rrdtool for this end, as well as for its output graphing. http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/
-----Original Message-----
Hi, We are running and linux server connected to internet via NIC and the ISP charge us base on our internet traffic usage (upload and download). How can I check the total of the internet traffic usage (all the port 80,25,110,..ICQ, mIRC...) on a workstation (each PC have it own IP address ? Can anybody advice ?
Best Regards, |