Pergunta

I'm trying to communicate 2 erlang nodes, server(on Amazon AWS) and client, over vpn. When I start the erlang shell I specified the node name and the cookie, but not work. There are special considerations for erlang communication via vpn? It is necessary to set the, in my case, tun0 device?

Thi is the routing result:

Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 10.8.0.5 128.0.0.0 UG 0 0 0 tun0
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 wlan0
10.8.0.1 10.8.0.5 255.255.255.255 UGH 0 0 0 tun0
10.8.0.5 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
46.51.166.55 192.168.1.254 255.255.255.255 UGH 0 0 0 wlan0
128.0.0.0 10.8.0.5 128.0.0.0 UG 0 0 0 tun0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0

Thanks in advance!

Foi útil?

Solução

I solved the problem.
This is the procedure.

Erlang server start by:
erl -name server@10.8.0.1 -setcookie aStringCookie -kernel inet_dist_listen_min 9000 inet_dist_listen_max 9005

10.8.0.1 is the VPN server IP

Client:
erl -name client@10.8.0.6 -setcookie aStringCookie -kernel inet_dist_listen_min 9000 inet_dist_listen_max 9005

10.8.0.6 is the VPN client IP

On the AWS security group i opened the 4369 TCP/UDP port and the other port used to initialize the server. I have also opened the ICMP port for the ping test.
In the VPN server configuration file you can enable/disable the line
push "redirect-gateway def1 bypass-dhcp" that redirect clients default network gateway through the VPN.

I tested some rpc an they work correctly.

Thanks all

Giovanni C

Outras dicas

I think the problem may be related with erl's long name and short name.

Did you use sname now?

-sname Name

Makes the Erlang runtime system into a distributed node, similar to -name, but the host name portion of the node name Name@Host will be the short name, not fully qualified.

This is sometimes the only way to run distributed Erlang if the DNS (Domain Name System) is not running. There can be no communication between nodes running with the -sname flag and those running with the -name flag, as node names must be unique in distributed Erlang systems.

http://www.erlang.org/doc/reference_manual/distributed.html

Are the firewall settings all correct? Erlang needs tcp connections between the epmd instances running on all hosts.

Try opening TCP port 4369, or accept whatever coming out from tun0.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top