From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Elise Lennion <elise.lennion@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH iptables] extensions: libxt_hashlimit: Add translation to nft
Date: Tue, 28 Feb 2017 12:21:00 +0100 [thread overview]
Message-ID: <20170228112100.GA19254@salvia> (raw)
In-Reply-To: <20170227174308.GA14613@lennorien.com>
On Mon, Feb 27, 2017 at 02:43:08PM -0300, Elise Lennion wrote:
> Hashlimit has similar functionality to flow tables in nftables. Some
> usage examples are:
>
> $ iptables-translate -A OUTPUT -m tcp -p tcp --dport 443 -m hashlimit \
> --hashlimit-above 20kb/s --hashlimit-burst 1mb --hashlimit-mode dstip \
> --hashlimit-name https --hashlimit-dstmask 24 -m state --state NEW \
> -j DROP
>
> nft add rule ip filter OUTPUT tcp dport 443 flow table https { ip \
> daddr and 255.255.255.0 timeout 60s limit rate over 20 kbytes/second \
> burst 1 mbytes} ct state new counter drop
>
> $ iptables-translate -A OUTPUT -m tcp -p tcp --dport 443 -m hashlimit \
> --hashlimit-upto 300 --hashlimit-burst 15 --hashlimit-mode \
> srcip,dstip --hashlimit-name https --hashlimit-htable-expire 300000 \
> -m state --state NEW -j DROP
>
> nft add rule ip filter OUTPUT tcp dport 443 flow table https { ip \
> daddr . ip saddr timeout 300s limit rate 300/second burst 15 packets} \
> ct state new counter drop
>
> The translation isn't supported when --hashlimit-mode isn't specified.
> Also, the following options don't apply to flow tables:
>
> --hashlimit-htable-size
> --hashlimit-htable-max
> --hashlimit-htable-gcinterval
Applied, thanks Elise.
I think it would be good to enhance the flow table article in the wiki
to describe how people can do hashlimit with nft.
prev parent reply other threads:[~2017-02-28 11:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-27 17:43 [PATCH iptables] extensions: libxt_hashlimit: Add translation to nft Elise Lennion
2017-02-28 11:21 ` Pablo Neira Ayuso [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=20170228112100.GA19254@salvia \
--to=pablo@netfilter.org \
--cc=elise.lennion@gmail.com \
--cc=netfilter-devel@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 NNTP newsgroup(s).