From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Kyle Swenson <kyle.swenson@est.tech>
Cc: "netfilter-devel@vger.kernel.org"
<netfilter-devel@vger.kernel.org>, "fw@strlen.de" <fw@strlen.de>
Subject: Re: [RFC PATCH v2 1/1] netfilter: nat: restore default DNAT behavior
Date: Wed, 7 Feb 2024 23:29:09 +0100 [thread overview]
Message-ID: <ZcQENZu3gcCb6AKC@calendula> (raw)
In-Reply-To: <20240129211227.815253-2-kyle.swenson@est.tech>
On Mon, Jan 29, 2024 at 09:12:54PM +0000, Kyle Swenson wrote:
> When a DNAT rule is configured via iptables with different port ranges,
>
> iptables -t nat -A PREROUTING -p tcp -d 10.0.0.2 -m tcp --dport 32000:32010
> -j DNAT --to-destination 192.168.0.10:21000-21010
>
> we seem to be DNATing to some random port on the LAN side. While this is
> expected if --random is passed to the iptables command, it is not
> expected without passing --random. The expected behavior (and the
> observed behavior in v4.4) is the traffic will be DNAT'd to
> 192.168.0.10:21000 unless there is a tuple collision with that
> destination. In that case, we expect the traffic to be instead DNAT'd
> to 192.168.0.10:21001, so on so forth until the end of the range.
>
> This patch is a naive attempt to restore the behavior seen in v4.4. I'm
> hopeful folks will point out problems and regressions this could cause
> elsewhere, since I've little experience in the net tree.
Would you post this without RFC tag and add provide a Fixes: tag.
Thanks.
prev parent reply other threads:[~2024-02-07 22:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-29 21:12 [RFC PATCH v2 0/1] netfilter: nat: restore default DNAT behavior Kyle Swenson
2024-01-29 21:12 ` [RFC PATCH v2 1/1] " Kyle Swenson
2024-02-07 22:29 ` 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=ZcQENZu3gcCb6AKC@calendula \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=kyle.swenson@est.tech \
--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).