Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Robert Nichols <rnicholsNOSPAM@comcast.net>
To: netfilter@vger.kernel.org
Subject: Re: (Ab)using iptables to record byte count per IP?
Date: Fri, 09 Jan 2009 11:10:08 -0600	[thread overview]
Message-ID: <gk80dh$4gs$1@ger.gmane.org> (raw)
In-Reply-To: <2d460de70901090444v20f514dck8bc7a7740ce84685@mail.gmail.com>

Richard Hartmann wrote:
> On Fri, Jan 9, 2009 at 12:50, Artūras Šlajus <x11@arturaz.net> wrote:
> 
>> iptables -A ACCOUNTING -s your_user_ip -j ACCEPT
>> iptables -A ACCOUNTING -d your_user_ip -j ACCEPT
> 
> Doesn't that mean that I am bypassing the rest of the
> firewall rules?

Yes, it would.  Just leave off the "-j ACCEPT" or use "-j RETURN" if
you want to bypass the rest of the ACCOUNTING chain.  There is no
requirement that a rule have a target.  I have a couple of rules
like that in my "mangle" table PREROUTING and POSTROUTING chains,
and they work just fine.

You'll want to use iptables with the "-x" flag when reading the
counters so that you get exact counts and not numbers like "14G".

-- 
Bob Nichols     "NOSPAM" is really part of my email address.
                 Do NOT delete it.


  reply	other threads:[~2009-01-09 17:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-09 11:27 (Ab)using iptables to record byte count per IP? Richard Hartmann
2009-01-09 11:50 ` Artūras Šlajus
2009-01-09 11:55   ` Thomas Jacob
2009-01-09 12:46     ` Richard Hartmann
2009-01-10  2:55     ` Amos Jeffries
2009-01-09 12:44   ` Richard Hartmann
2009-01-09 17:10     ` Robert Nichols [this message]
2009-01-09 12:35 ` Pablo Neira Ayuso
2009-01-09 12:47   ` Richard Hartmann
2009-01-09 15:23 ` Payam Chychi
2009-01-09 23:27   ` Vlado Drz(ík
2009-01-09 16:36 ` Peter Renzland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='gk80dh$4gs$1@ger.gmane.org' \
    --to=rnicholsnospam@comcast.net \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox