All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: "Anders K. Pedersen | Cohaesio" <akp@cohaesio.com>
Cc: "netfilter-devel@vger.kernel.org" <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH v4 nf-next] netfilter: nft: introduce routing expression
Date: Fri, 28 Oct 2016 10:24:09 +0200	[thread overview]
Message-ID: <20161028082409.GA7603@salvia> (raw)
In-Reply-To: <1477634055.1059.27.camel@cohaesio.com>

On Fri, Oct 28, 2016 at 05:54:15AM +0000, Anders K. Pedersen | Cohaesio wrote:
> From: Anders K. Pedersen <akp@cohaesio.com>
> 
> Introduces an nftables rt expression for routing related data with support
> for nexthop (i.e. the directly connected IP address that an outgoing packet
> is sent to), which can be used either for matching or accounting, eg.
> 
>  # nft add rule filter postrouting \
> 	ip daddr 192.168.1.0/24 rt nexthop != 192.168.0.1 drop
> 
> This will drop any traffic to 192.168.1.0/24 that is not routed via
> 192.168.0.1.
> 
>  # nft add rule filter postrouting \
> 	flow table acct { rt nexthop timeout 600s counter }
>  # nft add rule ip6 filter postrouting \
> 	flow table acct { rt nexthop timeout 600s counter }
> 
> These rules count outgoing traffic per nexthop. Note that the timeout
> releases an entry if no traffic is seen for this nexthop within 10 minutes.
> 
>  # nft add rule inet filter postrouting \
> 	ether type ip \
> 	flow table acct { rt nexthop timeout 600s counter }
>  # nft add rule inet filter postrouting \
> 	ether type ip6 \
> 	flow table acct { rt nexthop timeout 600s counter }
> 
> Same as above, but via the inet family, where the ether type must be
> specified explicitly.
> 
> "rt classid" is also implemented identical to "meta rtclassid", since it
> is more logical to have this match in the routing expression going forward.

Applied, thanks Anders!

      reply	other threads:[~2016-10-28  8:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-28  5:54 [PATCH v4 nf-next] netfilter: nft: introduce routing expression Anders K. Pedersen | Cohaesio
2016-10-28  8:24 ` Pablo Neira Ayuso [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=20161028082409.GA7603@salvia \
    --to=pablo@netfilter.org \
    --cc=akp@cohaesio.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.