From: Florian Westphal <fw@strlen.de>
To: Slavko <linux@slavino.sk>
Cc: netfilter@vger.kernel.org
Subject: Re: set with limit
Date: Tue, 19 Nov 2024 17:06:17 +0100 [thread overview]
Message-ID: <20241119160617.GA21970@breakpoint.cc> (raw)
In-Reply-To: <756a9507-5ecf-4ba4-a8d3-d364f13dbfd5@slavino.sk>
Slavko <linux@slavino.sk> wrote:
> with nft v1.0.6 and kernel 5.10.226 i want to limit logging count
> by IP. I setup set:
>
> set log_base4 {
> typeof ip saddr
> size 1000
> flags dynamic,timeout
> limit rate 1/minute burst 2 packets
> timeout 1h
> comment "IPv4 base log limit"
> }
>
> It is then used in chain:
>
> chain input {
> type filter hook input priority filter + 5; policy accept;
> ...
> update @log_base4 { ip saddr } log group 0
> }
>
> I see, that set is filled/updated by particular IP:
>
> elements = { X.Y.Z.W timeout 1h expires 59m59s360ms }
>
> But i see 15 lines per minute (it sends packet every 4 sec) for that
> IP. I expect max 2 lines per minute...
>
> Please what i did wrong?
Looks like 5.10 is too old, listing should show limit expression was
attached, i.e.:
elements = { x.y.z.w limit rate 1/minute burst 2 packets timeout 1h expires 59m55s504ms, ...
... (this is with 6.11.5 and your rules above).
next prev parent reply other threads:[~2024-11-19 16:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-19 12:03 set with limit Slavko
2024-11-19 16:06 ` Florian Westphal [this message]
2024-11-19 18:00 ` Slavko
2024-11-20 8:17 ` Slavko
2024-11-20 21:49 ` Pablo Neira Ayuso
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=20241119160617.GA21970@breakpoint.cc \
--to=fw@strlen.de \
--cc=linux@slavino.sk \
--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