From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Martin Bednar <martin@serafean.cz>
Cc: netfilter@vger.kernel.org
Subject: Re: nftables vmap concatenations with interval
Date: Tue, 27 Sep 2016 21:11:01 +0200 [thread overview]
Message-ID: <20160927191101.GA3195@salvia> (raw)
In-Reply-To: <11357773.LdaEAIBM0O@nemmerle>
On Tue, Sep 27, 2016 at 05:10:45PM +0200, Martin Bednar wrote:
> hi,
>
> using nftables, I want to create a vmap :
>
> map mymap {type ipv4_addr . iface_index : verdict }
>
> I'd like the first argument to be an ip range/ network, so that I can add like
> so :
> nft add element inet filter mymap { 172.18.0.1/24 . eth0 : accept }
>
> nft add element inet filter mymap { 172.18.0.1-172.18.0.255 . eth0 : accept }
>
> Any hints as to what to do it?
nft add table inet filter
nft add map inet filter mymap { type ipv4_addr . iface_index : verdict \; }
nft add element inet filter mymap { 172.18.0.0 . eth0 : accept }
nft add rule inet filter forward ip saddr and 255.255.255.0 . iif vmap @mymap
^^^^^^^^^^^^^^^^^^^^^^^^^^
The idea here is to mask the address, then add to the set the result
of this operation, thus, 172.18.0.0
next prev parent reply other threads:[~2016-09-27 19:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-27 15:10 nftables vmap concatenations with interval Martin Bednar
2016-09-27 19:11 ` Pablo Neira Ayuso [this message]
2016-09-28 12:51 ` Martin Bednar
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=20160927191101.GA3195@salvia \
--to=pablo@netfilter.org \
--cc=martin@serafean.cz \
--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