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