All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: "Bjørnar Ness" <bjornar.ness@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: nftables and sets
Date: Wed, 22 Jan 2014 14:44:23 +0000	[thread overview]
Message-ID: <20140122144423.GA14025@macbook.localnet> (raw)
In-Reply-To: <CAJO99T=OERsyTy91n=DJSceSdfxUeQVSO5JJtpMwuPyKh6MicQ@mail.gmail.com>

On Wed, Jan 22, 2014 at 03:09:30PM +0100, Bjørnar Ness wrote:
> Is it planned (or already implemented) support for multiple value vmaps?
> for example {type uid, type ipv4 : verdict}

We support so called concatenations, basically multiple types glued
together. You can use those for exact matches. However the kernel side
is missing a few bits so far.

Basically:

nft add map uidmap { type uid . ipv4_address : verdict; }
nft filter input uid . ip saddr @uidmap
nft add element uidmap { root . localhost : drop }

The combination doesn't make too much sense of course.

> Also, using iptables I am doing something like this
> 
> -A INPUT -j BLOCK
> -A BLOCK -m set --match-set ignorelist src -j RETURN
> -A BLOCK -m set --match-set blocklist src -j DROP
> 
> ..to make sure ips listed in ignorelist does not get blocked..
> 
> How would I do the same using nft?

nft add set ignorelist { type ipv4_address; }
nft add set blocklist { type ipv4_address; }

nft filter input jump block
nft filter block ip saddr @ignorelist return
nft filter block ip saddr @blocklist drop
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-01-22 14:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-22 14:09 nftables and sets Bjørnar Ness
2014-01-22 14:44 ` Patrick McHardy [this message]
     [not found]   ` <CAJO99T=HBk7_PJG8+SmkqA7NUDuWBvujGckBJ=R_wn0i-7MOsA@mail.gmail.com>
2014-01-22 15:26     ` Patrick McHardy

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=20140122144423.GA14025@macbook.localnet \
    --to=kaber@trash.net \
    --cc=bjornar.ness@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 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.