From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Liping Zhang <zlpnobody@163.com>
Cc: netfilter-devel@vger.kernel.org, fw@strlen.de,
Liping Zhang <zlpnobody@gmail.com>
Subject: Re: [PATCH iptables] extensions: libxt_rpfilter: add translation to nft
Date: Mon, 16 Jan 2017 14:14:55 +0100 [thread overview]
Message-ID: <20170116131455.GA19709@salvia> (raw)
In-Reply-To: <1483799206-59857-1-git-send-email-zlpnobody@163.com>
On Sat, Jan 07, 2017 at 10:26:46PM +0800, Liping Zhang wrote:
> From: Liping Zhang <zlpnobody@gmail.com>
>
> For example:
> # iptables-translate -t mangle -A PREROUTING -m rpfilter
> nft add rule ip mangle PREROUTING fib saddr . iif oif != 0 counter
>
> # iptables-translate -t mangle -A PREROUTING -m rpfilter --validmark \
> --loose
> nft add rule ip mangle PREROUTING fib saddr . mark oif != 0 counter
>
> # ip6tables-translate -t mangle -A PREROUTING -m rpfilter --validmark \
> --invert
> nft add rule ip6 mangle PREROUTING fib saddr . mark . iif oif 0 counter
>
> Finally, when the "--accept-local" option is specified, we can combine
> with "fib saddr type" to simulate it.
>
> But when it is used like this: "-m rpfilter --accept-local", it means "||"
> relationship, so we cannot translate it to one single nft rule,
> translation is not supported yet:
> # iptables-translate -t mangle -A PREROUTING -m rpfilter --accept-local
> nft # -t mangle -A PREROUTING -m rpfilter --accept-local
>
> When "--accpet-local" is combined with "--invert", it means "&&"
> relationship, so translation can be:
> # iptables-translate -t mangle -A PREROUTING -m rpfilter \
> --accept-local --invert
> nft add rule ip mangle PREROUTING fib saddr type != local fib saddr \
> . iif oif 0 counter
Also applied, thanks.
prev parent reply other threads:[~2017-01-16 13:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-07 14:26 [PATCH iptables] extensions: libxt_rpfilter: add translation to nft Liping Zhang
2017-01-16 13:14 ` 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=20170116131455.GA19709@salvia \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=zlpnobody@163.com \
--cc=zlpnobody@gmail.com \
/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).