This is a tutorial on how to start a manual OpenVPN connection when your Linux system boots.
NOTE: This tutorial does not show how to set up a manual OpenVPN connection to NordVPN on Linux. You must follow our guide on a manual OpenVPN connection to NordVPN before trying this tutorial.
Auto-connect OpenVPN via terminal
1. Create an auth.txt file inside the /etc/openvpn directory using the following command:
sudo gedit /etc/openvpn/auth.txtType in your NordVPN credentials (your username and password) on separate lines in the file and save it.
You can find your NordVPN service credentials (service username and service password) in the Nord Account dashboard:
-
- Click "NordVPN."
- Under "Manual setup," click on "Service credentials."
- You'll find your username and password, which you will need to be able to connect manually.
NOTE: In this tutorial, we will set up the Germany #75 server, but you should set up the server you configured in the manual OpenVPN connection guide.
2. Open the file you are using to establish a connection:
sudo gedit /etc/openvpn/ovpn_udp/de75.nordvpn.com.udp.ovpnNOTE: gedit is just a suggestion; you may use whatever text editor you like, for example, vim or nano.
Change this line:
auth-user-passto
auth-user-pass auth.txtSave the file and change its name:
sudo mv /etc/openvpn/ovpn_udp/de75.nordvpn.com.udp.ovpn /etc/openvpn/de75.conf3. Edit the OpenVPN boot file using this command:
sudo gedit /etc/default/openvpnWhen the text editor opens, add the following line above #AUTOSTART="all":
AUTOSTART="de75"Save the file and reboot your Linux device.
4. Once the device has rebooted, open the terminal and type in:
sudo traceroute 8.8.8.8The first hop address should be 10.8.8.1, and on ipleak.net, you should see the IP address of the German server you are connected to.
Auto-connect OpenVPN via Network Manager (Ubuntu)
First, set up the VPN connection using Network Manager.
Once the VPN connection is set up in the Network Manager, edit your main network connection and select Automatically connect to VPN when using this connection. In the drop-down list, select the VPN connection you previously created.