Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Pascal Hambourg <pascal.mail@plouf.fr.eu.org>
To: netfilter@vger.kernel.org
Subject: Re: PREROUTING table and quota
Date: Fri, 14 Nov 2008 11:15:49 +0100	[thread overview]
Message-ID: <491D4FD5.20906@plouf.fr.eu.org> (raw)
In-Reply-To: <1226628691.3932.5.camel@localhost.localdomain>

Michael a écrit :
> 
> So I will have to implement some rules in the filter table.

Or in the mangle table.

> As far as I
> can tell, though, the only way to share a quota counter between rules in
> the nat table and filter table is to implement it in userspace.  Is this
> correct?

If you mean share the quota result with other rules, you can use the 
MARK target to mark packets in the mangle table and test the packet mark 
with the mark match in other tables/chains.

# mark the packet if the quota is not exceeded
iptables -t mangle -A PREROUTING -m quota [...] -j MARK --set-mark 1
# test the mark
iptables -t nat -A PREROUTING -m mark [!] --mark 1 [...]

  reply	other threads:[~2008-11-14 10:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-13 12:15 PREROUTING table and quota Michael
2008-11-13 17:11 ` Pascal Hambourg
2008-11-14  2:11   ` Michael
2008-11-14 10:15     ` Pascal Hambourg [this message]
2008-11-15  2:06   ` Alternate routing table and source IP address question bsilva
2008-11-15 11:57     ` Pascal Hambourg

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=491D4FD5.20906@plouf.fr.eu.org \
    --to=pascal.mail@plouf.fr.eu.org \
    --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