Using OpenVPN with cheap VPS and NetworkManager

Ten post dostępny jest także w języku: pl

Another gathering of information laying around in various places over the web. This time I wanted to configure OpenVPN on cheap VPS (OVH classic) and my Linux laptops and Android devices. After great deal of problem solving here it is:

The easy part is installing OpenVPN on your VPS. Just follow the guide from DigitalOcean. Download your desired file (I use autologin version). It’s written for CentOS but works well on other distros too. In my case on Ubuntu Server.

The hard part is getting it to work with your laptop/desktop machines running Linux in some more handy way than:

sudo openvpn --config client.ovpn

So to get it working with NetworkManager and its import we need to split client.ovpn file into few smaller ones and install the following packages (Ubuntu/Debian):

sudo apt-get install openvpn network-manager-openvpn network-manager-openvpn-gnome

Than, following the great gist by Morley93:

Download the .ovpn file. Save it somewhere you can store it permanently (I use ~/.vpn).
Copy from between tags into ca.crt, remove tags.
Copy from between tags into client.crt, remove tags.
Copy from between tags into client.key, remove tags.
Copy from between tags into ta.key, remove tags.
Remove the line “key-direction 1”
Above “# —–BEGIN RSA SIGNATURE—–” insert the following lines.

ca ca.crt
cert client.crt
key client.key
tls-auth ta.key 1

Import the .ovpn file into NetworkManager and save the profile.

And that’s it! Android configuration is the easy part, just follow the instructions from client page of your OpenVPN and import your client.ovpn file there. It isn’t as bad as it says. Impact on battery life of your smartphone will be pretty minimal.

Podobne wpisy