3

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!

Giovanni C
  • 111
  • 8

3 Answers3

1

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

Giovanni C
  • 111
  • 8
0

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

Chen Yu
  • 3,955
  • 1
  • 24
  • 51
  • I use this syntax: erl -name client -setcookie cookie erl -name server -setcookie cookie I think that the problem is the tun0 device.It is necessary spiecified it? – Giovanni C Dec 04 '12 at 13:39
  • Is there any other network service ok between these two pc? If you don't these DNS, please check your /etc/hosts file. I think you have two network now, please check check route table. – Chen Yu Dec 04 '12 at 13:53
  • The VPN link work, I surf on internet through the AWS server. – Giovanni C Dec 04 '12 at 14:41
  • 1. have you practiced connection technique in the local network? 2. have you connect another internet erlang node in an without VPN environment? 3. Have you check all related related port for avoiding firewall problem? 4. have you check your ip details using ethereal/tcpdump tools? 5. I think erlang is the last cause should be considered before the above causes checked one by one. – Chen Yu Dec 04 '12 at 22:52
0

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.

l04m33
  • 586
  • 3
  • 12