From: Greg Stark <gsstark@mit.edu>
To: netfilter@lists.netfilter.org
Subject: Masquerading connections terminated inside on both ends
Date: 29 Jun 2003 17:59:08 -0400 [thread overview]
Message-ID: <87k7b44kb7.fsf@stark.dyndns.tv> (raw)
I imagine this is a FAQ but I haven't seen it discussed. I have a server and a
client machine both on the inside of my masquerading router. I can access the
server from the outside fine, and i can access the internet fine from the
client. But I'm not clear how to arrange things so I can reach the server from
the client.
Right now I have an entry in /etc/hosts to reach the server at its internal IP
address. However this isn't idea because then every client machine needs this
configuration or needs to use internal dns servers, and because then the
server needs to be specially configured and might not behave exactly the same
was in testing as it will from the outside.
My outside ip address is on the ppp0 interface. The server address is on eth1.
The client address is currently on eth1 as well but will eventually be on
eth2.
If I use masquerading rules based on the interface, which I prefer because it
seems simpler and less prone to abuse, then the machine doesn't even try to
NAT the packets since they're not coming in from ppp0.
If I write the rules to masquerade anything with a destination address of my
external ip address then it tries to DNAT the packets which is great, except
it doesn't do SNAT as well so the source address is still the internal address
on which interface the machine isn't expecting packets.
So I guess what I want the router to do for such connections is to do both
SNAT and DNAT. It should rewrite the packets coming from the client->router to
be from router->server and the return packets to be from router->client.
Is this even possible? What would the rules look like?
It seems this is a common situation. Does everyone just special case their
internal machines to use the internal addresses of their servers? It seems I
would want to use the internal address for privileged connections, but use the
external address for accessing normal externally accessible services to be
sure that I'm getting the same behaviour someone outside would see.
--
greg
next reply other threads:[~2003-06-29 21:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-29 21:59 Greg Stark [this message]
2003-06-30 3:45 ` Masquerading connections terminated inside on both ends Joel Newkirk
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=87k7b44kb7.fsf@stark.dyndns.tv \
--to=gsstark@mit.edu \
--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