From: "Jiwei Wang" <jiwei@taralnetworks.com>
To: netfilter@newkirk.us, netfilter@lists.netfilter.org
Subject: RE: Is it possible connecting to a forwarded port from inside the network?
Date: Sun, 16 Mar 2003 17:40:02 -0500 [thread overview]
Message-ID: <05ce01c2ec0c$fbdd1d10$0602000a@taralnetworks.com> (raw)
In-Reply-To: <200303161503.41910.netfilter@newkirk.us>
Thanks Joel. It works like a charm.
Jiwei
-----Original Message-----
From: Joel Newkirk [mailto:netfilter@newkirk.us]
Sent: Sunday, March 16, 2003 3:04 PM
To: Jiwei Wang; netfilter@lists.netfilter.org
Subject: Re: Is it possible connecting to a forwarded port from inside
the network?
On Sunday 16 March 2003 02:18 pm, Jiwei Wang wrote:
> Hello,
>
>
>
> I'm using iptables on a RedHat 8.0 box to do firewalling and port
> forwarding. The port-forwarding works perfectly when accessed from
> outside my internal networks. However, I cannot access the forwarded
> ports from inside the network.
>
>
>
> I tried to use two IP addresses to do this. That is, I have public IP
> addresses a.b.c.x and a.b.c.y both assigned to my Internet facing
> eth0; I use a.b.c.x for SNAT and a.b.c.y for DNAT port forwarding
> (a.b.c.y:80 is forwarded to an internal host port 80); from the
> Internet a.b.c.y:80 works ok, but I still cannot access a.b.c.y:80
> from any of my internal box.
add this, where d.e.f.y is the IP of the internal host, and d.e.f.z is
the internal IP of the firewalling box:
iptables -t nat -A POSTROUTING -o eth1 -d d.e.f.y -p tcp --dport 80 -j
SNAT --to d.e.f.z
This will force a.b.c.y to respond to the firewall instead of directly
to
the client, so that the reverse DNAT can take place. As it stands, the
server is probably trying to reply directly to the client, which is
discarding the reply. (it's waiting for a response from a.b.c.y, not
d.e.f.y!) Once the reply comes back to the firewall, it will undo the
SNAT, setting the destination of the reply back to the original client,
then it will undo the DNAT, setting the 'source' of the reply back to
the public IP a.b.c.y.
j
next prev parent reply other threads:[~2003-03-16 22:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-16 19:18 Is it possible connecting to a forwarded port from inside the network? Jiwei Wang
2003-03-16 20:03 ` Joel Newkirk
2003-03-16 22:40 ` Jiwei Wang [this message]
2003-03-17 18:17 ` alexb
2003-03-16 20:25 ` Cedric Blancher
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='05ce01c2ec0c$fbdd1d10$0602000a@taralnetworks.com' \
--to=jiwei@taralnetworks.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.