From: Deshwal Chand <CDD@kampsax.co.in>
To: 'Joel Newkirk' <netfilter@newkirk.us>,
"Herbert G. Fischer" <manager@trama.com>
Cc: NetFilter Users <netfilter@lists.netfilter.org>
Subject: RE: External Resolved IPs
Date: Tue, 17 Jun 2003 10:10:05 +0530 [thread overview]
Message-ID: <88116A11E9DFD411870900508BEC3831803B53@CPQ01> (raw)
[-- Attachment #1: Type: text/plain, Size: 2242 bytes --]
<<<iptables -t nat -A POSTROUTING -d 172.16.48.20 -s 172.16.48.0/24 -j SNAT
--to iptables.box.local.ip
<<With this additional rule in place, requests from local clients hit the
<<iptables box and are DNATted to the local server, then before leaving
This does not work.
-----Original Message-----
From: Joel Newkirk [mailto:netfilter@newkirk.us]
Sent: Tuesday, June 17, 2003 5:04 AM
To: Herbert G. Fischer
Cc: NetFilter Users
Subject: Re: External Resolved IPs
On Mon, 2003-06-16 at 17:00, Herbert G. Fischer wrote:
> My problem is that, when I try to connect to a internal server, using the
> external and real
> IP, I cannot because my FW/NAT appears to be confused or misconfigured.
>
> For example:
>
> Internal Network: 172.16.48.0/24
>
> My IP: 172.16.48.10
> Server Internal IP: 172.16.48.20
> * Both are on the same network
>
> Server External IP: 200.180.180.20 (IP alias on FW/NAT machine, that
> redirects to 172.16.48.20)
> DNS name of Server: server.domain.com, points to 200.180.180.20
> # server
> iptables -t nat -A POSTROUTING -s 172.16.48.20 -j SNAT --to-source
> 200.180.180.20
> iptables -t nat -A PREROUTING -s 0/0 -d 200.180.180.20 -j
> DNAT --to-destination 172.16.48.20
>
> # NAT for the rest of the world
> iptables -t nat -A POSTROUTING -o eth1 -s 172.16.48.0/24 -j SNAT
--to-source
> 200.180.180.22
When a request from a local client arrives at the iptables box addressed
to 200.180.180.20, it hits PREROUTING and is DNATted to the appropriate
server. Problem is that the server tries to reply directly to the
client, (since it's a local IP) which sees a 'new' connection from
172.16.48.20, which it ignores. Try adding:
iptables -t nat -A POSTROUTING -d 172.16.48.20 -s 172.16.48.0/24 -j SNAT
--to iptables.box.local.ip
With this additional rule in place, requests from local clients hit the
iptables box and are DNATted to the local server, then before leaving
the iptables box they are SNATted so that the server sends its reply
back to the iptables box. When that reply is received by the iptables
box, it unSNATs and restores the correct destination IP (the local
client) then before it leaves the box it unDNATs to restore the correct
source IP (the local server's public IP).
j
[-- Attachment #2: Type: text/html, Size: 4085 bytes --]
next reply other threads:[~2003-06-17 4:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-17 4:40 Deshwal Chand [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-06-17 5:33 External Resolved IPs Deshwal Chand
2003-06-17 3:59 Deshwal Chand
2003-06-16 21:00 Herbert G. Fischer
2003-06-16 22:33 ` Joel Newkirk
2003-06-17 15:46 ` Herbert G. Fischer
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=88116A11E9DFD411870900508BEC3831803B53@CPQ01 \
--to=cdd@kampsax.co.in \
--cc=manager@trama.com \
--cc=netfilter@lists.netfilter.org \
--cc=netfilter@newkirk.us \
/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