All of lore.kernel.org
 help / color / mirror / Atom feed
* How to account traffic in IPTABLES?
@ 2003-03-30 13:47 ` Bobo
  0 siblings, 0 replies; 5+ messages in thread
From: Bobo @ 2003-03-30 13:47 UTC (permalink / raw)
  To: netfilter-devel, netfilter-devel; +Cc: netfilter, netfilter

 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?

  Are there some tools for traffic accounting of iptables?

  I could use perl and shell programing.Could I analyze the log file of iptables to account?

  Thanks





^ permalink raw reply	[flat|nested] 5+ messages in thread

* How to account traffic in IPTABLES?
@ 2003-03-30 13:47 ` Bobo
  0 siblings, 0 replies; 5+ messages in thread
From: Bobo @ 2003-03-30 13:47 UTC (permalink / raw)
  To: netfilter-devel; +Cc: netfilter

 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?

  Are there some tools for traffic accounting of iptables?

  I could use perl and shell programing.Could I analyze the log file of iptables to account?

  Thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to account traffic in IPTABLES?
  2003-03-30 13:47 ` Bobo
  (?)
@ 2003-03-30 21:02 ` Steven Schmidt
  -1 siblings, 0 replies; 5+ messages in thread
From: Steven Schmidt @ 2003-03-30 21:02 UTC (permalink / raw)
  To: Bobo; +Cc: netfilter

Have a look at IPAC-NG in sourceforge. Works well.

----- Original Message -----
From: "Bobo" <boboaq@163.com>
To: <netfilter-devel@lists.netfilter.org>
Cc: <netfilter@lists.netfilter.org>
Sent: Monday, March 31, 2003 1:47 AM
Subject: How to account traffic in IPTABLES?


> 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?
>
>   Are there some tools for traffic accounting of iptables?
>
>   I could use perl and shell programing.Could I analyze the log file of
iptables to account?
>
>   Thanks
>
>
>
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to account traffic in IPTABLES?
  2003-03-30 13:47 ` Bobo
  (?)
  (?)
@ 2003-03-31 17:10 ` Stephane Ouellette
  2003-04-07 16:34   ` Raymond Leach
  -1 siblings, 1 reply; 5+ messages in thread
From: Stephane Ouellette @ 2003-03-31 17:10 UTC (permalink / raw)
  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(<CHAINS>)
{
# read the lines one by one, matching on the text you want
}

close(CHAINS);

>  Thanks
>
>
>
>
>
>  
>





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to account traffic in IPTABLES?
  2003-03-31 17:10 ` Stephane Ouellette
@ 2003-04-07 16:34   ` Raymond Leach
  0 siblings, 0 replies; 5+ messages in thread
From: Raymond Leach @ 2003-04-07 16:34 UTC (permalink / raw)
  To: Netfilter Mailing List

[-- Attachment #1: Type: text/plain, Size: 2829 bytes --]

Hi

Create an accounting chain:

IPTABLES=/sbin/iptables

### accounting chain
$IPTABLES -N accounting
$IPTABLES -A accounting -i eth0 -d $IP_INT_MAIL -j RETURN
$IPTABLES -A accounting -o eth0 -s $IP_INT_MAIL -j RETURN
$IPTABLES -A accounting -i eth0 -d $IP_INT_WEB7 -j RETURN
$IPTABLES -A accounting -o eth0 -s $IP_INT_WEB7 -j RETURN
$IPTABLES -A accounting -i eth0 -d $IP_INT_WEB1 -j RETURN
$IPTABLES -A accounting -o eth0 -s $IP_INT_WEB1 -j RETURN
$IPTABLES -A accounting -i eth0 -d $IP_INT_WEB3 -j RETURN
$IPTABLES -A accounting -o eth0 -s $IP_INT_WEB3 -j RETURN
$IPTABLES -A accounting -i eth0 -d $IP_INT_WEB4 -j RETURN
$IPTABLES -A accounting -o eth0 -s $IP_INT_WEB4 -j RETURN
$IPTABLES -A accounting -i eth0 -d $IP_INT_ORA2 -j RETURN
$IPTABLES -A accounting -o eth0 -s $IP_INT_ORA2 -j RETURN
$IPTABLES -A accounting -i eth2 -s $NET_INT -d ! $NET_DMZ -j RETURN
$IPTABLES -A accounting -o eth2 -s ! $NET_DMZ -d $NET_INT -j RETURN
$IPTABLES -A INPUT -j accounting
$IPTABLES -A FORWARD -j accounting
$IPTABLES -A OUTPUT -j accounting

Then to see the traffic use:
/sbin/iptables -nvL accounting


On Mon, 2003-03-31 at 19:10, Stephane Ouellette wrote:
> 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(<CHAINS>)
> {
> # read the lines one by one, matching on the text you want
> }
> 
> close(CHAINS);
> 
> >  Thanks
> >
> >
> >
> >
> >
> >  
> >
> 
> 
-- 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(  Raymond Leach                       )
 ) Knowledge Factory                  (
(                                      )
 ) Tel: +27 11 445 8100               (
(  Fax: +27 11 445 8101                )
 )                                    (
(  http://www.knowledgefactory.co.za/  )
 ) http://www.saptg.co.za/            (
(  http://www.mapnet.co.za/            )
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   o                                o
    o                              o
        .--.                  .--.
       | o_o|                |o_o |
       | \_:|                |:_/ |
      / /   \\              //   \ \
     ( |     |)            (|     | )
     /`\_   _/'\          /'\_   _/`\
     \___)=(___/          \___)=(___/


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-04-07 16:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-30 13:47 How to account traffic in IPTABLES? Bobo
2003-03-30 13:47 ` Bobo
2003-03-30 21:02 ` Steven Schmidt
2003-03-31 17:10 ` Stephane Ouellette
2003-04-07 16:34   ` Raymond Leach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.