Anonymize your internet traffic
Disclaimer: This article is purely for educational purposes only. I do not condone piracy.
Install OpenVPN
Unfortunately, the Ubuntu and Debian repositories are not always up to date. It is recommended to use the latest OpenVPN release to make sure you have the latest security fixes (and possible updates). In case of Ubuntu Server the official OpenVPN repository always provides the latest version. In case of ARM CPUs like the Rasperry Pi running Raspbian or Minibian, we need to build the latest version since the OpenVPN repository doesn’t provide builds for ARM based devices. It is quite easy to build OpenVPN from source (stay tuned for the guide), until then, on Debian, Minibian and Raspbian you can use the version available in the Debian repository.
sudo mkdir -p /etc/apt/keyrings/
wget -O- https://swupdate.openvpn.net/repos/repo-public.gpg | gpg --dearmor | sudo tee /etc/apt/keyrings/openvpn.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/openvpn.gpg] http://build.openvpn.net/debian/openvpn/stable jammy main" | sudo tee /etc/apt/sources.list.d/openvpn.list
Warning: Do not use apt-key anymore. See this for more information. And see here to remove the old key from trusted.gpg
Configure Mullvad OpenVPN
There are different VPN providers out there. I use Mullvad. They have a very good privacy policy and they don’t keep any logs. Their pricing is transparent and a fair model.
Download the openvpn configuration from Mullvad here
I am going to use Ubuntu’s builtin service manager to start and stop the OpenVPN service.
unzip mullvad_xx.zip
sudo mv mullvad_xx.conf /etc/openvpn/mullvad.conf
sudo mv mullvad_ca.crt /etc/openvpn/
sudo mv mullvad_userpass.txt /etc/openvpn/
Openvpn uses templatized systemd jobs, openvpn@CONFIGFILENAME. So if for example your configuration file is myserver.conf your service is called openvpn@myserver.
Enable mullvad and start the service
sudo systemctl enable openvpn@mullvad
sudo systemctl start openvpn@mullvad
Find status using journalctl or systemctl
sudo journalctl -u openvpn@mullvad -xe
sudo systemctl status openvpn@mullvad
Fix DNS leaks
Use the scripts from https://github.com/macvk/dnsleaktest to check for DNS leaks