I have two virtual machines that use internal IP addresses to speak to one another while the outside world knows about these VMs only via external IP addresses.
I h
Before answering the question, I want to point out, that Distributed Erlang is not secure and you should not use it outside of trusted local area network. (I had to leave that comment after I saw "external ip address", I assume it doesn't mean public). Below is a list of 4 important things, you should be aware of:
When you start a node, it is good to give it a name like this:
erl -name myname@192.168.0.1
When you try to connect to that node from other machine, you can use something like this in erlang shell:
net_kernel:connect('myname@192.168.0.1').
The important part is that node name: 'myname@192.168.0.1' is an atom. It is not "name and ip" - it is one thing. Even, if your second node is on the same machine, you can't use:
net_kernel:connect('myname@127.0.0.1').
because it is different node name.
This means, that to connect two nodes, only one has to see the other.
Example: you have:
than:
In the second case, the connections is just as if they were on the same network. You only have to think about who should initialise the connection.
If you don't want to that - use hidden nodes.
But I think, you have that covered, if you were able connect other nodes.
The easiest solution is to use external ip addresses everywhere, because Erlang distribution was designed to run on local network. Harder solution involves making sure, that you connect from nodes in local network to nodes with external ip.