All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Bednar <martin@serafean.cz>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter@vger.kernel.org
Subject: Re: nftables vmap concatenations with interval
Date: Wed, 28 Sep 2016 14:51:50 +0200	[thread overview]
Message-ID: <6538549.qvO97AaWzG@nemmerle> (raw)
In-Reply-To: <20160927191101.GA3195@salvia>

Le Tuesday, September 27, 2016 9:11:01 PM CEST Pablo Neira Ayuso a écrit :
> 
> 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

Very cool trick... Thanks. this solves 90% of what I want :)
This however implies the same mask for all networks, right?
Is is somehow possible to have one vmap for networks with different masks?

Thanks.

      reply	other threads:[~2016-09-28 12:51 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
2016-09-28 12:51   ` Martin Bednar [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=6538549.qvO97AaWzG@nemmerle \
    --to=martin@serafean.cz \
    --cc=netfilter@vger.kernel.org \
    --cc=pablo@netfilter.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 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.