Ubuntu – Connecting to Private Internet Access server using OpenVPN and Ubuntu 16.04 server

16.04openvpnservervpn

Can someone please give me a guide to setup a vpn connection (that connects on startup) using openvpn and ubuntu 16.04 server. all the guides on the internet are wrong, outdated, or just don't work. i have an account with private internet access and i just want to setup a connection. something i feel should be very simple but i lack the experience needed as this is my first server and I'm still learning.

Best Answer

Start by downloading this: https://www.privateinternetaccess.com/openvpn/openvpn.zip and extract it somewhere.

That archive contains 3 important files: ca.crt, crl.pem and YourServer.ovpn (e.g. Germany.ovpn), copy those to /etc/openvpn/. Rename the .ovpn file to .conf and add a line auth-user-pass secrets Create a new file /etc/openvpn/secrets with your PIA username on the first and your password on the second line, like this:

p1234567
MyPIAPassword

For security reasons you should chmod 600 that.

See if your connection works: systemctl start openvpn@YourServer (e.g. systemctl start openvpn@Germany. Debug as necessary: tail -f /var/log/syslog|grep ovpn and systemctl status openvpn@YourServer

If it works, make it run on startup by editing /etc/default/openvpn and uncommenting the line that says AUTOSTART="all"

Related Question