LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help getting traffic value (https://www.linuxquestions.org/questions/linux-newbie-8/help-getting-traffic-value-726323/)

landysaccount 05-15-2009 09:09 PM

Help getting traffic value
 
Hello.

I am wondering how can I find out how much traffic a client has consumed on a linux router at a point of time. For example I guess I should run a script (bash or php) to find out how many bytes has pass through the router to and from ip 192.168.2.100. I would like to know how I can get that value.

I know if I issue iptables -nvL | grep 192.168.2.100 I get some values but, if the router gets restarted or iptables rules are flushed I'll loose those values.

Any idea?

Thanks in advanced.

Tinkster 05-16-2009 07:02 PM

Have a look at ulogd, or similar solutions. They allow you
to store iptables accounting information into e.g. a postgreSQL
database (which will keep track over reboots).


Cheers,
Tink


All times are GMT -5. The time now is 06:31 PM.