From: Steve Mickeler <steve@warning.ca>
To: netfilter@lists.netfilter.org
Subject: SNAT interfering with source IP of a DNAT
Date: Tue, 4 Mar 2003 21:18:01 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.53.0303042109030.29516@gypsy> (raw)
I've been beating my head against the table for the past couple of hours
trying to get this working properly.
I'm doing a PREROUTING DNAT that will send any traffic destined to
10.10.10.8 and DNAT it to 192.168.32.12
The DNAT works, but what keeps happening is the POSTROUTING rules further
down the chain is changing the source IP to 192.168.32.6 instead of
retaining the original source IP.
What I need is the POSTROUTING SNAT rule to -ONLY- take place when an
attempt to access 192.168.32.12 is established from anything else except
the PREROUTING DNAT.
here are the 2 PREROUTING and POSTROUTING entries:
$IPT -t nat -A PREROUTING -d 10.10.10.8 -j DNAT --to 192.168.32.12
...skip a bunch of other rules.
$IPT -t nat -A POSTROUTING -s 172.17.0.0/19 -d 192.168.32.0/24 -j SNAT
--to-source 192.168.32.6
Right now, when I ssh to 10.10.10.8 it changes my source IP to
192.168.32.6 because I'm coming from 172.17.3.24, but I'd like to avoid
that unless I'm ssh'ing to 192.168.32.12 directly.
The easiest thing to do would be to avoid the POSTROUTING SNAT but its a
requirement I have to make sure anything going to 192.168.32.0/24 gets
nat'ed to 192.168.32.6
Any ideas of how to get around this ?
Thanks.
next reply other threads:[~2003-03-05 2:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-05 2:18 Steve Mickeler [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-03-05 6:24 SNAT interfering with source IP of a DNAT ImpulseFG
2003-03-05 6:39 ` Steve Mickeler
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=Pine.LNX.4.53.0303042109030.29516@gypsy \
--to=steve@warning.ca \
--cc=netfilter@lists.netfilter.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