All of lore.kernel.org
 help / color / mirror / Atom feed
* [nftables] netdev rate limiting | timeouts rfq
@ 2020-09-22 22:49 ѽ҉ᶬḳ℠
  2020-09-23  8:30 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 16+ messages in thread
From: ѽ҉ᶬḳ℠ @ 2020-09-22 22:49 UTC (permalink / raw)
  To: netfilter

[-- Attachment #1: Type: text/plain, Size: 1991 bytes --]

kernel 5.9.0-rc6 armv7l | nft 0.9.6

------

(1) netdev rate limiting

/table netdev filter {//
//        set glv4 {//
//                type ipv4_addr//
//                size 65535//
//                flags dynamic,timeout//
//                counter//
//                timeout 15m//
//                gc-interval 10s//
//        }//
//        chain input {//
//                type filter hook ingress device "eth2" priority -500;
policy accept;//
//                ip saddr @glv4 counter packets 0 bytes 0 log prefix
"nd glv4 DROP" flags all drop//
//        }

/Then however

/nft add rule netdev filter input ip protocol tcp { ip saddr limit rate
over 50/second burst 15 packets } update @glv4 { ip saddr }/

producing:

Error: syntax error, unexpected saddr, expecting comma or '}'
add rule netdev filter input ip protocol tcp { ip saddr limit rate over
50/second burst 15 packets } update @glv4 { ip saddr }
^^^^^

Is rate limiting not meant for the netdev chain or where do I go wrong
with the syntax?

----

(2) timeouts

Like in the above statement is the timeout applicable to the entire set,
i.e. the entire gets wiped after 15 min, or the timeout applies
selectively to each entry?

Perusing
https://www.netfilter.org/projects/nftables/manpage.html#lbANhttps://www.netfilter.org/projects/nftables/manpage.html#lbAN

/nft add rule ip filter input tcp flags syn tcp dport ssh meter flood
size 128000 { ip saddr *timeout 10s* limit rate over 10/second} add
@blackhole { ip saddr *timeout 1m* } drop

/I fail to comprehend what the first statement (/timeout 10s/) achieves;
what is the purpose?

As for the second statement (/timeout 1m/) I am wondering whether it
would clash with or supersede the statement in the set (e.g. /timeout
15m/ as in the above example)?
//



[-- Attachment #2: OpenPGP_0xF4F735931F05C5CE.asc --]
[-- Type: application/pgp-keys, Size: 3112 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-09-28 19:19 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-22 22:49 [nftables] netdev rate limiting | timeouts rfq ѽ҉ᶬḳ℠
2020-09-23  8:30 ` Pablo Neira Ayuso
2020-09-28 11:02   ` ѽ҉ᶬḳ℠
2020-09-28 11:52     ` Pablo Neira Ayuso
2020-09-28 12:08       ` ѽ҉ᶬḳ℠
2020-09-28 12:24         ` Pablo Neira Ayuso
2020-09-28 13:10           ` ѽ҉ᶬḳ℠
2020-09-28 15:43             ` Pablo Neira Ayuso
2020-09-28 16:03               ` ѽ҉ᶬḳ℠
2020-09-28 16:23                 ` Pablo Neira Ayuso
2020-09-28 16:47                   ` ѽ҉ᶬḳ℠
2020-09-28 17:01                     ` Pablo Neira Ayuso
2020-09-28 17:38                       ` ѽ҉ᶬḳ℠
2020-09-28 17:56                         ` Pablo Neira Ayuso
2020-09-28 18:15                           ` ѽ҉ᶬḳ℠
2020-09-28 19:19                             ` ѽ҉ᶬḳ℠

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.