From: "Gáspár Lajos" <swifty@freemail.hu>
To: James Anderson <japanwikidonate@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: quota display in iptables -L
Date: Fri, 09 Mar 2012 15:07:50 +0100 [thread overview]
Message-ID: <4F5A0EB6.9000604@freemail.hu> (raw)
In-Reply-To: <CAL2t0L5bnu9pX_h01HtvEaurdhDa_QHdc6OeVfy3e4hoKe893g@mail.gmail.com>
Hi,
31997506400-31997506128=272
You are under the quota!
Maybe you had just bigger packets than 272 bytes...
Swifty
2012-03-09 01:19 keltezéssel, James Anderson írta:
> Hello everyone.
>
> I have been trying to get iptables to stop traffic to the internet
> after I have exceeded 29.8 GB and just allow traffic to the local
> subnet after that. I did the conversion on google and apparently
> 29.8GB is 31997506400 bytes. However tonight when I got home and did
> iptables -L -v, I saw this:
>
> Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
> pkts bytes target prot opt in out source
> destination
> 28M 32G ACCEPT all -- any any anywhere
> !192.168.2.0/24 quota: 31997506400 bytes
> 2459K 3621M ACCEPT all -- any any anywhere
> 192.168.2.0/24
> 5770 1151K REJECT all -- any any anywhere
> anywhere reject-with icmp-port-unreachable
>
> At first I thought the quota didn't work, but then I did iptables-save -c
>
> *filter
> :INPUT ACCEPT [23078834:14787771556]
> :FORWARD ACCEPT [0:0]
> :OUTPUT ACCEPT [0:0]
> [28216466:31997506128] -A OUTPUT ! -d 192.168.2.0/24 -m quota --quota
> 31997506400 -j ACCEPT
> [2475569:3622559686] -A OUTPUT -d 192.168.2.0/24 -j ACCEPT
> [24154:2350411] -A OUTPUT -j REJECT --reject-with icmp-port-unreachable
> COMMIT
>
> which shows that it stopped at 29.7999998 GB.
> Could someone perhaps explain the discrepancy?
> Does iptables keep counting bytes even after the quota is full?
>
> many thanks in advance,
>
> James
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-03-09 14:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAL2t0L4JR-kPUogudF+vWaypYjQmCPureZE6yM4PjYEVV+XhTg@mail.gmail.com>
[not found] ` <CAL2t0L4r5ANvRyM=7Spnx68=wMcQCTR7qDH94V4-TRbXCKA-Gg@mail.gmail.com>
[not found] ` <CAL2t0L4AjXx8QR22Q5cdh6ndPpmmrr58x-t6HG7kHZ6UadtOBg@mail.gmail.com>
2012-03-09 0:19 ` quota display in iptables -L James Anderson
2012-03-09 14:07 ` Gáspár Lajos [this message]
2012-03-09 16:35 ` James Anderson
2012-03-09 17:21 ` Gáspár Lajos
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=4F5A0EB6.9000604@freemail.hu \
--to=swifty@freemail.hu \
--cc=japanwikidonate@gmail.com \
--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