Setting up NordVPN on the raspberry pi

2025-03-09

Whether you are a cybercriminal, internet pirate, or Netflix user, a VPN can sometimes prove useful. I got a subscription with NordVPN, and in this article I will go through the steps I took to start using it on my Raspberry pi. I use a version of Raspberry pi OS based on Debian bookworm, but the setup should be pretty much the same for any Linux distribution. First, we need to install a VPN client. I didn’t want to use NordVPN’s client as I don’t need its features and I may want to use other VPN providers besides Nord. Luckily, NordVPN also supports OpenVPN and provides all the config files that we need. By googling “nordvpn raspberry pi” I landed on this page, and I followed the steps for the “manual connection method” with some modifications.

Install openvpn

sudo apt install openvpn

The documentation asks us to disable IPv6 before installing openvpn, and it’s a good idea to follow this advice. However, I am running other services on my Raspberry pi, and my router is stuck in a dual-stack lite configuration, so I don’t have a public IPv4: IPv6 is the only way to reach my device from the internet. I’ll write more about this inconvenience in the last section, but for now let’s assume that IPv6 is disabled.

Download the configuration files

cd /etc/openvpn
sudo curl -O 'https://downloads.nordcdn.com/configs/archives/servers/ovpn.zip'
sudo unzip ovpn.zip

This will download files for all the servers available in NordVPN. We could as well have downloaded just the file for the server that we wanted to connect to, but it doesn’t harm to keep all of them.

Connect to the VPN

sudo openvpn <config_file>

Here, <config_file> is the path to the config file for the server you decided to use. You will be asked for credentials, which can be found in the “service credentials” tab of the recommended server page in the NordVPN website.

Confirm that it worked

Check your IP.

curl ipinfo.io/ip

And now you can let NordVPN know everything you do on the internet!

Extra: Keep using IPv6 alongside the VPN

I haven’t properly figured this out yet, I’ll just dump some references here and hopefully I’ll come back to edit this section at a later time. The basic idea is that OpenVPN brings up a tun0 interface with its own IPv4, and in principle each application that we want to hide behind the VPN could be configured to use only that interface. However, the details of how to do it are application specific and sometimes it is not even possible to select an interface (just an IP address). I am not even sure that it matters, but anyway, there are some relatively new Linux and systemd features that we could explore.

:wq

 Marginalia

Leave a comment