From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephane Ouellette Subject: Re: How to account traffic in IPTABLES? Date: Mon, 31 Mar 2003 12:10:29 -0500 Sender: netfilter-devel-admin@lists.netfilter.org Message-ID: <3E887685.9070000@videotron.ca> References: <20030330134802.CF9351C462B39@sm204.163.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7BIT Return-path: Errors-To: netfilter-devel-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: Content-Type: text/plain; charset="us-ascii" To: Bobo Cc: "netfilter-devel@lists.netfilter.org" , "netfilter@lists.netfilter.org" Bobo wrote: > HI > > I use the iptables + squid as the gateway of one LAN,and it is very good in fact. > > Now,I would like to get the traffic accounting of each IP of the LAN. > > How to get these data ? Does IPtables contain these data? > > try this one: iptables -nvL INPUT > Are there some tools for traffic accounting of iptables? > > The iptables command itself !!! > I could use perl and shell programing.Could I analyze the log file of iptables to account? > > in Perl: open(CHAINS, "iptables -nvL INPUT|") or die "Error reading chains\n"; while() { # read the lines one by one, matching on the text you want } close(CHAINS); > Thanks > > > > > > >