From: <imnozi@gmail.com>
To: Sven-Haegar Koch <haegar@sdinet.de>, netfilter@vger.kernel.org
Subject: Re: IPv4 NAT and lo, and iptables
Date: Tue, 30 Apr 2024 20:46:25 -0400 [thread overview]
Message-ID: <20240430204625.19335253@playground> (raw)
In-Reply-To: <184bed16-17ab-d6ee-992b-2e094b639016@sdinet.de>
Thank you! It *is* an oddity; but it's the nature of the beast. Added two rules and it works.
Cheers 'n' beers!
Neal
On Wed, 1 May 2024 01:03:28 +0200 (CEST)
Sven-Haegar Koch <haegar@sdinet.de> wrote:
> On Tue, 30 Apr 2024, imnozi@gmail.com wrote:
>
> > Questions:
> > - Is lo ignored in PREROUTING?
> > - Is it possible to DNAT local traffic on FW_A (changing) the public IP to
> > the private IP on LAN_2?
> > - Would I specify '-i lo' in mangle:PREROUTING and nat:PREROUTING (as I do
> > for the real NICs)?
> >
> > The uber questions are:
> > - Should I be able to DNAT and SNAT traffic on lo just as I can on other
> > LANs, or do I need to take extra steps?
>
> Locally generated traffic does not pass nat PREROUTING chain - you need
> to add matching DNAT rules to the nat OUTPUT chain if you want dnat
> rewriting applied to it.
>
> And similar traffic targetting the local system (after DNAT) does not
> pass POSTROUTING, if you want such traffic SNAT'ed you need to use the
> nat INPUT chain.
>
> > - Is this a known oddity? or was it known back around Linux 3.16 and
> > iptables 1.6? (Don't ask; sometimes we're stuck in a place we don't
> > want to be.)
>
> c'ya
> sven-haegar
>
prev parent reply other threads:[~2024-05-01 0:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-30 22:22 IPv4 NAT and lo, and iptables imnozi
2024-04-30 23:03 ` Sven-Haegar Koch
2024-05-01 0:46 ` imnozi [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=20240430204625.19335253@playground \
--to=imnozi@gmail.com \
--cc=haegar@sdinet.de \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).