Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: "Atkins, Brian" <Brian.Atkins@netapp.com>
Cc: "netfilter@vger.kernel.org" <netfilter@vger.kernel.org>
Subject: Re: Output port redirect going to loopback?
Date: Thu, 15 Aug 2024 20:35:17 +0200	[thread overview]
Message-ID: <20240815183517.GA6867@breakpoint.cc> (raw)
In-Reply-To: <DM8PR06MB77179054B381DB1DA67B0D4DF9872@DM8PR06MB7717.namprd06.prod.outlook.com>

Atkins, Brian <Brian.Atkins@netapp.com> wrote:
> I have the following nat table:
> table inet nat {
>         chain prerouting {
>                 type nat hook prerouting priority dstnat; policy accept;
>                 tcp dport 10999 counter packets 0 bytes 0 redirect to :9999
>         }
> 
>         chain input {
>                 type nat hook input priority 100; policy accept;
>         }
> 
>         chain output {
>                 type nat hook output priority -100; policy accept;
>                 oif "eth0" ip daddr 172.16.5.220 meta nftrace set 1
>                 oifname "eth0" tcp dport 9999 counter packets 620 bytes 37200 redirect to :10999
>         }
> 
>         chain postrouting {
>                 type nat hook postrouting priority srcnat; policy accept;
>         }
> }
> 
> I would expect to connect outbound on 9999 and have it redirect to 10999 and reach an IP address on my subnet, for example:
> # telnet 172.16.5.220 9999
> Trying 172.16.5.220...
> telnet: Unable to connect to remote host: Connection refused

Expected, redirect is 'dnat to local machine'.

  reply	other threads:[~2024-08-15 18:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-14 19:09 Output port redirect going to loopback? Atkins, Brian
2024-08-15 18:35 ` Florian Westphal [this message]
2024-08-15 18:48   ` Atkins, Brian

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=20240815183517.GA6867@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=Brian.Atkins@netapp.com \
    --cc=netfilter@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