Installing TURN server
Sometimes SocialVPN nodes cannot connect because of crazy NATs (i.e. symmetric) or strict firewalls. In such cases, we rely on relaying. This page shows you how to run a TURN relay in the cloud. We are currently using the following TURN implementation. TURN servers require a public IP address.
These instructions have only been tested on Ubuntu 12.04 (64-bit).
-
Install TURN implementation dependencies
sudo apt-get update sudo apt-get install libconfuse0
-
If you are running on the cloud (e.g. EC2), you need to use IP aliasing to allow the TURN server to bind your public IP address
sudo ifconfig eth0:0 <public-ip-of-vm> up
-
Download and extract pre-packaged TURN binaries
wget -O turn.tgz http://goo.gl/EMzy9Z tar xzvf turn.tgz
-
Update the TURN config file with the public IP address
sed -i 's/listen_address = .*/listen_address = { "public-ip-address" }/g' turn/turn.conf
-
(Optional) Update turn.conf to increase number of sessions per users
vi turn/turn.conf ## Max relay per username. max_relay_per_username = 100000 ## Allocation lifetime. allocation_lifetime = 720000
-
(Optional) Increase file descriptor limit to allow for thousands of TURN connections by adding following to
/etc/security/limits.conf
file. Be sure to log out and log back in for changes to take effect.ubuntu hard nofile 100000 ubuntu soft nofile 100000
-
Run the TURN server
cd turn; ./turnserver -c turn.conf; cd ..
-
Verify TURN server is running
netstat -aupn | grep 19302
-
Update your config.json file with your TURN settings, see below for template
{ "ip4": "172.31.0.100", "xmpp_username": "ipopuser@ejabberd", "xmpp_password": "password", "xmpp_host": "public-ip-of-ejabberd-server", "stun": ["public-ip-of-your-vm:19302"], "turn": [ {"server": "public-ip-of-your-vm:19302", "user": "svpnjingle", "pass": "1234567890"} ] }
- Building the code
- IPOP packages
- Running SocialVPN nodes
- Running GroupVPN nodes
- Deploying OSN and NAT traversal services
- Test and monitoring
- Extending the code
- General documentation