From: Frank Myhr <fmyhr@fhmtech.com>
To: Stefan Hartmann <stefanh@hafenthal.de>,
"netfilter.org" <netfilter@vger.kernel.org>
Subject: Re: nftables 0.9.3, sets with concatentation
Date: Sat, 21 Mar 2020 10:24:21 -0400 [thread overview]
Message-ID: <1fc782a6-3e76-1a8d-e8fa-4dede579458c@fhmtech.com> (raw)
In-Reply-To: <3c04f9dd-85a1-7bc8-0b8d-72a5afb24a5c@hafenthal.de>
On 2020/03/21 06:17, Stefan Hartmann wrote:
> Thank you Florian and Frank for your suggestions. Yes, I found it now
> also in the man page under "RAW PAYLOAD EXPRESSION".
>
> I tested step for step:
>
> ip daddr $IP4_IF2 meta l4proto {udp, tcp} @th,16,16 {69, 23} accept
>
> ip daddr $IP4_IF2 meta l4proto . @th,16,16 {udp . 69, tcp . 23} accept
>
> ip daddr $IP4_IF2 meta l4proto . @th,16,16 @CONCATENATED_SET_3 accept
>
> and verified with netcat - it is functional in this way.
Thanks for confirming that the above work.
And incidentally thank you for prompting me to look up character length
limits on set names and other nftables objects. After cutting my
firewall teeth using ipchains I'm leery of longish identifiers. AFAICT
limits were/are:
ipchains: 8 characters (!)
https://www.tldp.org/HOWTO/IPCHAINS-HOWTO-4.html
iptables: 29 characters
https://github.com/torvalds/linux/blob/master/include/uapi/linux/netfilter/x_tables.h
#define XT_EXTENSION_MAXNAMELEN 29
nftables: 256 characters
https://github.com/torvalds/linux/blob/master/include/uapi/linux/netfilter/nf_tables.h
#define NFT_NAME_MAXLEN 256
#define NFT_TABLE_MAXNAMELEN NFT_NAME_MAXLEN
#define NFT_CHAIN_MAXNAMELEN NFT_NAME_MAXLEN
#define NFT_SET_MAXNAMELEN NFT_NAME_MAXLEN
#define NFT_OBJ_MAXNAMELEN NFT_NAME_MAXLEN
> Could there be issues with conntrack, nat, etc with this approach?
> I will test it in the next days.
I wouldn't expect so, but please report back.
> Firstly I will start with separate UDP and TCP service groups.
Sounds reasonable to me.
> Nb. I use separate ipv4 and ipv6 tables, because they are really
> different protocols. In my experience the mixing leads often to
> overlooked security flaws - I am working as pentester occasionally.
Thanks for your observation.
Cheers,
Frank
prev parent reply other threads:[~2020-03-21 14:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-20 15:51 nftables 0.9.3, sets with concatentation Stefan Hartmann
2020-03-20 16:37 ` Florian Westphal
2020-03-20 16:41 ` Frank Myhr
2020-03-20 16:46 ` Frank Myhr
2020-03-21 10:17 ` Stefan Hartmann
2020-03-21 14:24 ` Frank Myhr [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=1fc782a6-3e76-1a8d-e8fa-4dede579458c@fhmtech.com \
--to=fmyhr@fhmtech.com \
--cc=netfilter@vger.kernel.org \
--cc=stefanh@hafenthal.de \
/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