[erlang-questions] Distributed Erlang ... alternate port?

Romain Lenglet romain.lenglet@REDACTED
Mon Mar 17 06:01:53 CET 2008


The best solution is to run the SSH tunnel by configuring the SSH client as a 
SOCKS server:
> ssh -D 4080 -L ...

Then, you can use tsocks, or other transparent SOCKS wrappers, to redirect all 
connections open by erl through the tunnel that was open that way:
> tsocks erl ...

Of course, you have to configure tsocks to use your local SOCKS server on port 
4080 for the connections that you want to tunnel. A working tsocks.conf could 
look like:

server=localhost
server_port=4080
server_type=5

Cf. http://tsocks.sourceforge.net/

Dante offers similar wrapping mechanisms on the client side:
http://www.inet.no/dante/

--
Romain Lenglet

On Monday 17 March 2008 10:49, Mike Berrow wrote:
> >> Is there a way to run distributed erlang through an alternate port ?
> >> [...]
> >>  I know erlang needs both TCP and UDP on port 4369 normally.
> >>  Is there any way to configure it to use other ports?
> >
> > Yes, but there are two different TCP ports you should be aware of.
> >
> > First is epmd, which is what listens on 4369.  This number is hard
> > coded into the Erlang binaries.  It looks like you can change the
> > definition of EPMD_PORT_NO in erts/epmd/epmd.mk, but I've never played
> > with this.
> >
> > Second is erlang's distribution code, which uses the kernel
> > application's inet_dist_listen_min and inet_dist_listen_max to decide
> > what TCP port to listen on.  After creating a listening socket, it
> > registers this port with epmd.
>
> Hmmm.  So, at the remote node, epmd will be listening on 4369.  I was
> hoping that I could get erlang on the local machine to believe it could
> connect to an apparently  "local" erlang epmd on a different port (the
> local ends of the tunnels I make). But if that is hard coded on both ends,
> I guess I am out of luck without going to some very custom build. That
> would be a pity.
> The "inet_dist_listen_min and inet_dist_listen_max" also indicates that
> there are even other ports coming into play that I would need to re-map.
>
> A use case example I can offer is monitoring and control of many,
> geographically dispersed remote weather stations. The access restriction is
> that I can only get in (practically) through the ssh port (22). There is no
> opening of extra ports through firewalls. That's the motivation for the
> tunneling approach.
>
> -- Mike Berrow
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list