OpenVPN configuration


 1. Update information about packages:

sudo apt-get update

 2. Install OpenVPN client:

sudo apt-get install openvpn

 3. Download and unpack configuration files from your customer area: https://vpntunnel.com/en/account/server-info

sudo unzip /etc/openvpn/configs.zip -d  /etc/openvpn
sudo rm -rf /etc/openvpn/configs.zip
sudo rename "s/.ovpn/.conf/" /etc/openvpn/*.ovpn

 4. Show all available locations:

ls /etc/openvpn/*.conf

 5. Set up connection:

sudo openvpn --config /etc/openvpn/Milan.conf

 

Optionally: autostart connection at boot time


1. Create file with your credentials:  

echo 'username' | sudo tee /etc/openvpn/creds.txt
echo 'password' | sudo tee --append /etc/openvpn/creds.txt

 2. Change configuration files:

sudo sed -i 's/auth-user-pass/auth-user-pass \/etc\/openvpn\/creds.txt/g' /etc/openvpn/*.conf

 3. Edit /etc/default/openvpn. Replace "Milan" With location that you need.

echo "AUTOSTART=\"Milan\"" | sudo tee --append /etc/default/openvpn