On Nov 16, 3:53*pm, Noisome <Noiso...@gmail.com> wrote:
> On Nov 15, 12:24*pm, Cacadril <en...@online.no> wrote:
> > On Nov 15, 4:44*pm, j.g.too...@gmail.com wrote:
>
> > > Hey all,
>
> > > I am attempting to do (I think this is the right term) a reverse proxy
> > > for any TCP port/protocol, not just HTTP.
>
> > > Essentially, I want:
> > > ssh/telnet/ftp/etc internet.server1.com ==> WANIP_ADDRESS ==>
> > > 10.10.10.1
> > > ssh/telnet/ftp/etc internet.server2.com ==> WANIP_ADDRESS ==>
> > > 10.10.10.2
>
> > > So all ports that come in from internet.server1.com go to my WAN IP
> > > ADDRESS, and redirects it to 10.10.10.1 and all ports from
> > > internet.server2.com go to my WAN IP ADDRESS, and redirects it to
> > > 10.10.10.2.
>
> > Do you mean ...
> > *- you are running a linux box? ...
> > *- acting as a gateway? ...
> > *- between your local network and the internet? ...
> > *- and you want that any tcp connection being initiated by
> > * *datagrams coming from the internet? ...
> > *- shall be forwarded to specific IP addresses on the local network ?
> > *- depending on the IP address of the *source* of this connection
> > attempt?
>
> > Ooops, I shall now suppose the anser to the above questions is *no*.
>
> Thanks for your reply, and your assumption is incorrect. *I am running
> a linux box...acting as a gateway...between my local network and the
> internet...and want that any tcp connection being initiated by
> datagrams coming from the internet...shall be forwarded to the
> specific IP address on the local network...depending on the DOMAIN
> NAME that the source of this connection is attempt to come through.
>
> So now that you got that off your chest feeling better? *Good. *
Sorry for sounding condescending.
The domain name that the source is attempting to come THROUGH,
what does that mean?
Is it the name that the source has used to locate your WAN IP address?
That would be the typical case of a reverse proxy. If so, the answer
to my question would be no, and my stated assumption (that the answer
is no) would be right, since in my question I asked if the routing
would depend on a domain name associated with the source itself.
The telnet protocol, for instance, does not have any provision for
transmitting any domain names. The client, or source, uses a domain
name to determine an IP address, your WAN IP. This happens locally, in
the client computer, or communicating with a dns server, but without
communication with your local network or your gateway. Once the client
has determined the IP address, it uses that IP address, not the domain
name, to establich the connection with your gateway or server or proxy
server. During the connection establishment, there is no exchange of
text strings like domain names. If your proxy server is to learn what
domain name the client used to determine the WAN IP, this must happen
through some other means than the telnet protocol. This is of course
possible, but not within the telnet protocol itself. It could well be
some method that uses the telnet connection, once established with
your gateway, to transmit the domain name using some other protocol
running inside the telnet protocol. That means that if you want
something that works automatically and transparently for random telnet
clients anywhere in the world, no, that is not possible. Guaranteed
not possible. But if you can use a method where the user of the telnet
client takes som extra steps, before or after, especially after,
establishment of the telnet connection, then it is possible. But I
don't know about any ready-made tool. You, or I, for that matter,
would have to make one. I don't think it would be hard. That would be
a tool that works for the telnet protocol. Other protocols would be
separate problems.
I said "guaranteed not possible" because the datagrams arriving at
your gateway are *identical* bit for bit, whether the client started
with looking up "internet.server1.com" or "internet.server2.com".
There would be nothing any system installed in your gateway could use
to base its decision on. The only data available to a telnet server is
the WAN IP of the client and the WAN IP of the server, the port number
used by the client as source port, and the port number used by the
client as the destination port. However, this information cannot be
varied in any way, in the general, automatic and transparent case.
If the clients are related to you, not random people anywhere in the
world, but rather people you can make special arrangements with, then
all this changes. Then you could use e.g. nonstandard destination
ports, or even artificially modified source port numbers.
The easiest way in the latter case would perhaps be to use virtual
lans.
Regards.