From: Sreedhar M <sreemtech@gmail.com>
To: Kerin Millar <kfm@plushkava.net>
Cc: netfilter@vger.kernel.org
Subject: Re: nftables rate limiting per multiple seconds
Date: Fri, 8 Mar 2024 11:44:31 +0000 [thread overview]
Message-ID: <CANvpR2BZ7xjjbJz6P-THeSHw-uTVuOWTPfeBX98kAKp_49TL2w@mail.gmail.com> (raw)
In-Reply-To: <55db52fb-ad08-402d-ab2f-9106ddd538fe@app.fastmail.com>
Great Kerin. Good to know the optional.
Thanks again.
Best Regards
Sreedhar
On Fri, Mar 8, 2024 at 10:34 AM Kerin Millar <kfm@plushkava.net> wrote:
>
> On Fri, 8 Mar 2024, at 10:19 AM, Sreedhar M wrote:
> > Great Kerin. Thank you so much for the support.
> >
> > With the below rules specially using 'add' and all my uses cases are working.
> > nft add set ip filter myrate { type ipv4_addr . inet_service; flags
> > timeout ; flags dynamic; timeout 10s; }
> > nft add rule ip filter INPUT tcp dport 7880 ct state new add @myrate {
> > ip saddr . th dport limit rate over 1/day burst 15 packets } counter
> > drop
>
> One more thing occurs to me. Now that you are using "add" and, given that "1/day" might otherwise appear confusing in the course of reviewing a ruleset, you could probably get away with changing the element template to:
>
> { ip saddr . th dport limit rate over 6/minute burst 15 packets }
>
> Consider it optional; the behaviour should not change at all. Still, it does, perhaps, better hint at the underlying policy i.e. something should happen after 10 (60/6) seconds. Normally, that would be the bucket being credited with a token but it is my understanding that the timeout policy should prevail.
>
> --
> Kerin Millar
--
Best Regards
Sreedhar
prev parent reply other threads:[~2024-03-08 11:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 22:11 nftables rate limiting per multiple seconds Sreedhar M
2024-03-06 22:39 ` Kerin Millar
2024-03-07 10:08 ` Sreedhar M
2024-03-07 12:30 ` Kerin Millar
2024-03-07 17:10 ` Sreedhar M
2024-03-07 23:11 ` Sreedhar M
2024-03-08 2:03 ` Kerin Millar
2024-03-08 7:26 ` Sreedhar M
2024-03-08 8:07 ` Kerin Millar
2024-03-08 9:12 ` Sreedhar M
2024-03-08 9:55 ` Kerin Millar
2024-03-08 10:19 ` Sreedhar M
2024-03-08 10:34 ` Kerin Millar
2024-03-08 11:44 ` Sreedhar M [this message]
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=CANvpR2BZ7xjjbJz6P-THeSHw-uTVuOWTPfeBX98kAKp_49TL2w@mail.gmail.com \
--to=sreemtech@gmail.com \
--cc=kfm@plushkava.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).