This is a tutorial on how to start an OpenVPN connection when your Linux system boots.
Auto-connect OpenVPN via terminal
1. Create anauth.txtfile inside the/etc/openvpndirectory using the following command:
sudo gedit /etc/openvpn/auth.txt
Type in your NordVPN credentials (your username and password) on the separate lines in the file and save it.
You can find your NordVPN service credentials (service username and service password) in theNord Account dashboard:
- ClickSet up NordVPN manually.
- You will receive averification codein youremail that you use for NordVPN services. Type the codein:
- Copy the credentials using the “Copy” buttons on the right:
- ClickSet up NordVPN manually.
2. Open the file you are using to establish a connection:
sudo gedit /etc/openvpn/openvpn_udp/de75.nordvpn.com.udp.ovpn
Change this line:
auth-user-pass
to
auth-user-pass auth.txt
Save the file and change its name:
sudo mv /etc/openvpn/openvpn_udp/de75.nordvpn.com.udp.ovpn /etc/openvpn/de75.conf
3. Edit theopenvpnboot file using this command:
sudo gedit /etc/default/openvpn
When 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.8
The first hop address should be 10.8.8.1, and onipleak.netyou 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 selectAutomatically connect to VPN when using this connection. In the drop-down list, select the VPN connection you previously created.