Allstar VPN HamVoip

Creating a VPN For HamVoip:

Rent a server for $12 a year from VirMach. You want 14.04 Ubuntu server and I recommend not upgrading it. Below is script code to run on your new 14.04 server. When creating the script and uploading to the server make sure its set to 7777.

Put the script in the root director for the 14.04 server and run it (./your_script). You will need to add port forwarding to the firewall. Directory /etc/init.d/ modify firewall file lineĀ  approx-70 to add your UDP if different from 22. Line approx-78 add any TCP and/or UDP ports you use. Save and restart firewall (service firewall restart).

Copy the client file from the server root directory (client.conf) to Hamvoip node etc/openvpn directory. Add a line of code on the node in file (etc/rc.local) => (/etc/openvpn/start-openvpn client.conf).

Boot node and check registration, will show your VPN ip address if everything is working.

Script:

#!/bin/bash
#

# This script from Greg’s KD3SU website

# http://kd3su.crabdance.com/?Ham_Radio___IRLP___Setting_up_VPN_on_a_VPS_Server

# You must be using ubuntu 14.04 to be sure the script below works correctly

##################################################

sleep 1
echo “now installing the VPN server software”
sleep 1
echo “run modprobe tun to install the tunnel to the kernal”
modprobe tun
sleep 1
apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 40976EAF437D05B5
sleep 1
apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 3B4FE6ACC0B21F32
sleep 1
apt-get update
sleep 1
wget http://kd3su.crabdance.com/openvpn-install.sh
# wget https://git.io/vpn -O openvpn-install.sh
sleep 1
chmod u+x ./openvpn-install.sh
sleep 1
./openvpn-install.sh
sleep 5

echo “now installing the firewall”
sleep 5
wget http://k5nx.com/firewall_modified1
sleep 1
mv /root/firewall_modified1 /root/firewall
sleep 1
cp ./firewall /etc/init.d/firewall
sleep 1
cd /etc/init.d
sleep 1
chmod +x firewall
sleep 1
cd /
sleep 1
update-rc.d -f firewall defaults
sleep 3

echo “now its time to start up the vpn server”
/etc/init.d/openvpn start
sleep 3
echo “now its time to start the firewall”
service firewall start
sleep 1

echo “now copy the client config file config.ovpn to config.conf which is required for nano nodes”

cp /root/client.ovpn /root/client.conf

sleep 1

echo ” ”
echo ” ”
echo “Done! …. End of Script…. Good bye!”