From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Piyush Pangtey <gokuvsvegita@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH v5] extensions: libxt_multiport: Add translation to nft
Date: Tue, 15 Mar 2016 02:06:04 +0100 [thread overview]
Message-ID: <20160315010604.GA23490@salvia> (raw)
In-Reply-To: <20160313084618.GA3913@fate>
On Sun, Mar 13, 2016 at 02:16:18PM +0530, Piyush Pangtey wrote:
> Added full translation for multiport
>
> Examples :
> $ iptables-translate -A input -p tcp -m multiport --ports ssh:http -j ACCEPT
> nft add rule ip filter input ip protocol tcp tcp dport ssh - http tcp sport ssh - http counter accept
--ports is not so easy to translate as this implies an 'or'. But what
you expressed above is an 'and'.
So please return 0 for this case so we remember that we currently have
no translation for this. Actually, I remember Shivani documented this
on wiki.nftables.org.
> $ iptables-translate -A input -p sctp -m multiport --dports 11:18 -j ACCEPT
> nft add rule ip filter input ip protocol sctp sctp dport 11 - 18 counter accept
Almost there.
Note that nft generates the dependencies for you, so you can simplify
this translation above to:
$ iptables-translate -A input -p tcp -m multiport --dports ssh:http -j ACCEPT
nft add rule ip filter input tcp dport 22-80 counter accept
> $ iptables-translate -A input -p dccp -m multiport --sports 11:18 -j ACCEPT
> nft add rule ip filter input ip protocol dccp dccp sport 11 - 18 counter
> accept
You can remove "ip protocol dccp".
> $ ip6tables-translate -A input -p udplite -m multiport --sports 11:18 -j ACCEPT
> nft add rule ip6 filter input meta l4proto udplite udplite sport 11 - 18
> counter accept
You can also remove "meta l4proto udplite".
Please, don't forget to test that nft accepts the syntax that you
propose as translation.
Thanks.
next prev parent reply other threads:[~2016-03-15 1:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-13 8:46 [PATCH v5] extensions: libxt_multiport: Add translation to nft Piyush Pangtey
2016-03-15 1:06 ` Pablo Neira Ayuso [this message]
2016-03-15 3:39 ` Piyush Pangtey
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=20160315010604.GA23490@salvia \
--to=pablo@netfilter.org \
--cc=gokuvsvegita@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 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).