All of lore.kernel.org
 help / color / mirror / Atom feed
* related to -z option
@ 2004-03-10 11:47 rohit persaie
  2004-03-10 18:55 ` Antony Stone
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: rohit persaie @ 2004-03-10 11:47 UTC (permalink / raw)
  To: netfilter

Dear All,

There is one option in iptables .....-Z , used for  the  packet  and byte 
counters in all the chains.

Please tell me the use of this option, with example.

with regards ,

persaie

_________________________________________________________________
Take a loan. Win great prizes! Handsome prizes to be won!  Take a loan & win 
TV, Fridge & many more prizes ! http://go.msnserver.com/IN/44044.asp



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

* Re: related to -z option
  2004-03-10 11:47 related to -z option rohit persaie
@ 2004-03-10 18:55 ` Antony Stone
  2004-03-10 19:00 ` [despammed] " Andreas Kretschmer
  2004-03-10 19:02 ` Daniel Chemko
  2 siblings, 0 replies; 4+ messages in thread
From: Antony Stone @ 2004-03-10 18:55 UTC (permalink / raw)
  To: netfilter

On Wednesday 10 March 2004 11:47 am, rohit persaie wrote:

> Dear All,
>
> There is one option in iptables .....-Z , used for  the  packet  and byte
> counters in all the chains.
>
> Please tell me the use of this option, with example.

# clear the packet counters to zero
iptables -Z

# wait for some traffic to go through the machine (eg: come back tomorrow)
sleep 86400

# look at the counters now to find out how much traffic has matched each rule
iptables -L -nvx

# Repeat as long as the information interests you

Regards,

Antony.

-- 
Programming is a Dark Art, and it will always be. The programmer is
fighting against the two most destructive forces in the universe:
entropy and human stupidity. They're not things you can always
overcome with a "methodology" or on a schedule.

 - Damian Conway, Perl God

                                                     Please reply to the list;
                                                           please don't CC me.



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

* Re: [despammed] related to -z option
  2004-03-10 11:47 related to -z option rohit persaie
  2004-03-10 18:55 ` Antony Stone
@ 2004-03-10 19:00 ` Andreas Kretschmer
  2004-03-10 19:02 ` Daniel Chemko
  2 siblings, 0 replies; 4+ messages in thread
From: Andreas Kretschmer @ 2004-03-10 19:00 UTC (permalink / raw)
  To: netfilter

am  Wed, dem 10.03.2004, um 11:47:09 +0000 mailte rohit persaie folgendes:
> Dear All,
> 
> There is one option in iptables .....-Z , used for  the  packet  and byte 
> counters in all the chains.
> 
> Please tell me the use of this option, with example.

Please read the man-page:

 -Z, --zero [chain]
       Zero the packet and byte counters in all chains.  It  is  legal  to
       specify  the  -L, --list (list) option as well, to see the counters
       immediately before they are cleared. (See above.)


You can use iptable to count traffic, and you can reset the counters.


Andreas
-- 
Diese Message wurde erstellt mit freundlicher Unterstützung eines freilau-
fenden Pinguins aus artgerechter Freilandhaltung.   Er ist garantiert frei
von Micro$oft'schen Viren. (#97922 http://counter.li.org)     GPG 7F4584DA
Was, Sie wissen nicht, wo Kaufbach ist? Hier: N 51.05082°, E 13.56889° ;-)


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

* Re: related to -z option
  2004-03-10 11:47 related to -z option rohit persaie
  2004-03-10 18:55 ` Antony Stone
  2004-03-10 19:00 ` [despammed] " Andreas Kretschmer
@ 2004-03-10 19:02 ` Daniel Chemko
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Chemko @ 2004-03-10 19:02 UTC (permalink / raw)
  To: rohit persaie; +Cc: netfilter

If you have an accouting tool which doesn't handle accumulative 
statistics gathering, you will have to zero the counters right after the 
probe. Not ideal, but a hack to make some acocunting packages work.

Eg:
I probe an ipables rule ever 5 min.


Minute 0
    iptables -Z
    iptables -nvxL | grep ... | awk '{print $2}'
    5345
    iptables -Z
Minute 5
    iptables -nvxL | grep ... | awk '{print $2}'
    5454
    iptables -Z
Accounting with a non-acumulative counter == 5345,5454
Accounting with an acumulative counter == 5345,109 (wrong)


Minute 0
    iptables -Z
    iptables -nvxL | grep ... | awk '{print $2}'
    5345
Minute 5
    iptables -nvxL | grep ... | awk '{print $2}'
    10799
Accounting with a non-acumulative counter == 5345,10799 (wrong)
Accounting with an acumulative counter == 5345,5454


rohit persaie wrote:

> Dear All,
>
> There is one option in iptables .....-Z , used for  the  packet  and 
> byte counters in all the chains.
>
> Please tell me the use of this option, with example.
>
> with regards ,
>
> persaie
>
> _________________________________________________________________
> Take a loan. Win great prizes! Handsome prizes to be won!  Take a loan 
> & win TV, Fridge & many more prizes ! 
> http://go.msnserver.com/IN/44044.asp
>
>


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

end of thread, other threads:[~2004-03-10 19:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-10 11:47 related to -z option rohit persaie
2004-03-10 18:55 ` Antony Stone
2004-03-10 19:00 ` [despammed] " Andreas Kretschmer
2004-03-10 19:02 ` Daniel Chemko

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.