All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Taube <no_html.max50kb@nurfuerspam.de>
To: netfilter@vger.kernel.org
Subject: nftables: How to add bordering ip-ranges to a named set
Date: Wed, 6 Jul 2016 18:51:21 +0200	[thread overview]
Message-ID: <nljcua$m72$1@ger.gmane.org> (raw)

Hi,

if I define a named set in nftables
> nft 'add set inet filter black2 {type ipv4_addr; flags interval; }'
> nft add element inet filter black2 { 192.168.1.1/24 }

it is not possible to add bordering ip-ranges:
> nft add element inet filter black2 { 192.168.2.1/24 }
> <cmdline>:1:1-49: Error: Could not process rule: File exists
> add element inet filter black2 { 192.168.2.1/24 }
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

but if I add the ranges in ONE command it works:
> nft add element inet filter black2 { 192.168.1.1/24, 192.168.2.1/24 }

then the ranges are put together to one ip-range:
> # nft list set inet filter black2
> table inet filter {
> 	set black2 {
> 		type ipv4_addr
> 		flags interval
> 		elements = { 192.168.1.0-192.168.2.255}
> 	}
> }

How it is possible to create a set to flexible add and delete bordering 
ip-ranges?

mfg
Matthias





             reply	other threads:[~2016-07-06 16:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06 16:51 Matthias Taube [this message]
2016-07-07 18:33 ` nftables: How to add bordering ip-ranges to a named set Pablo Neira Ayuso
2016-07-08 18:19   ` Matthias Taube

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='nljcua$m72$1@ger.gmane.org' \
    --to=no_html.max50kb@nurfuerspam.de \
    --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 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.