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 nftables] rt: introduce routing expression
Date: Fri, 28 Oct 2016 10:33:08 +0200 [thread overview]
Message-ID: <20161028083308.GB27947@salvia> (raw)
In-Reply-To: <1477634191.1059.30.camel@cohaesio.com>
On Fri, Oct 28, 2016 at 05:56:32AM +0000, Anders K. Pedersen | Cohaesio wrote:
> From: Anders K. Pedersen <akp@cohaesio.com>
>
> Introduce 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.
next prev parent reply other threads:[~2016-10-28 8:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-28 5:56 [PATCH v4 nftables] rt: introduce routing expression Anders K. Pedersen | Cohaesio
2016-10-28 8:33 ` Pablo Neira Ayuso [this message]
2016-10-28 8:43 ` Pablo Neira Ayuso
2016-10-28 11:31 ` Anders K. Pedersen | Cohaesio
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=20161028083308.GB27947@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).