From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Florian Westphal <fw@strlen.de>,
netfilter-devel@vger.kernel.org, netfilter@vger.kernel.org,
John Stultz <john.stultz@linaro.org>, JP Abgrall <jpa@google.com>
Subject: Re: [PATCH 1/1] netfilter: xtables: add quota support to nfacct
Date: Fri, 3 Jan 2014 16:54:10 +0100 [thread overview]
Message-ID: <20140103155410.GA13894@localhost> (raw)
In-Reply-To: <CANLsYkzRPDQsKFDsHTZKDOLmX=_yhBa3FBCbuY1-Uy2TG3jYQg@mail.gmail.com>
On Mon, Dec 30, 2013 at 04:14:21PM -0700, Mathieu Poirier wrote:
> On 30 December 2013 15:17, Mathieu Poirier <mathieu.poirier@linaro.org> wrote:
> > Hey Florian - I think that is an acceptable compromise. The LOG chain
> > and rules are extra but it is setup only once and as such scale well.
> >
> > Thank you for that,
> > Mathieu
> >
> > On 30 December 2013 14:46, Florian Westphal <fw@strlen.de> wrote:
> >> Mathieu Poirier <mathieu.poirier@linaro.org> wrote:
> >>> Upon reaching the limit of 10000 byte of http traffic, any outgoing
> >>> http packets will be dropped and a single broadcast message will be
> >>> sent to user space. That is because the match explicitly takes care
> >>> of sending the notification.
> >>>
> >>> With your proposal:
> >>>
> >>> iptables -I OUTPUT -p http \
> >>> -m nfacct --nfacct-name http-limit --quota 10000 --match-once \
> >>> -j NFLOG --nflog-prefix "http: " --nflog-group 34
> >>>
> >>> will log the quota reached event but won't prevent further http
> >>> traffic from going out. One could instinctively add another rule
> >>> right after the above one, something like:
> >>>
> >>> iptables -I OUTPUT -p http \
> >>> -m nfacct --nfacct-name http-limit --quota 10000 \
> >>> -j REJECT
> >>>
> >>> but that won't work either because the packet/byte could will be
> >>> incremented twice.
> >>
> >> The usual workaround is to create custom chains to deal with this,
> >> i.e.
> >> iptables -N LOG_DROP_HTTP
> >> iptables -A LOG_DROP_HTTP -j NFLOG --nflog-prefix "http: " --nflog-group 34
> >> iptables -A LOG_DROP_HTTP -j REJECT
> >> iptables -I OUTPUT -p http -m nfacct ... -j LOG_DROP_HTTP
>
> I may have spoken too quickly. With this solution a log message is
> sent every time a packet over quota is received, something we
> definitely want to avoid. I was able to cover that case when sending
> a notification from the match function.
Then, keep your code to send netlink notifications, I don't find any
better solution at this moment.
next prev parent reply other threads:[~2014-01-03 15:54 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-11 16:53 [PATCH 0/1] Add quota capabilities to nfacct mathieu.poirier
2013-12-11 16:53 ` [PATCH 1/1] netfilter: xtables: add quota support " mathieu.poirier
2013-12-18 9:53 ` Pablo Neira Ayuso
[not found] ` <CANLsYkxMzdFCpJ3456PPd8KsEPi-U70kJDqGv8c3BhCsKY8RiQ@mail.gmail.com>
2013-12-19 19:43 ` Pablo Neira Ayuso
2013-12-20 20:34 ` Mathieu Poirier
2013-12-21 8:55 ` Pablo Neira Ayuso
2013-12-29 21:53 ` Mathieu Poirier
2013-12-30 17:36 ` Pablo Neira Ayuso
2013-12-30 17:56 ` Mathieu Poirier
2013-12-30 21:46 ` Florian Westphal
2013-12-30 22:17 ` Mathieu Poirier
2013-12-30 23:14 ` Mathieu Poirier
2013-12-30 23:31 ` Florian Westphal
2014-01-03 15:54 ` Pablo Neira Ayuso [this message]
2014-01-03 20:38 ` Mathieu Poirier
2014-01-04 2:32 ` Pablo Neira Ayuso
[not found] ` <CANLsYkw4UhBGpUcvO9qqqvgz8j00=E6zojMxxXCsPQhStQtGXg@mail.gmail.com>
2014-01-13 21:50 ` Mathieu Poirier
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=20140103155410.GA13894@localhost \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=john.stultz@linaro.org \
--cc=jpa@google.com \
--cc=mathieu.poirier@linaro.org \
--cc=netfilter-devel@vger.kernel.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 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.