How can we help you?

How to start OpenVPN on boot using Linux?

This is a tutorial on how to start an OpenVPN connection when your Linux system boots.

Auto-connect OpenVPN via terminal

1. Create auth.txt file inside /etc/openvpn directory via this command:

  • sudo gedit /etc/openvpn/auth.txt

Fill it with your NordVPN credentials:

  • username
  • password

Save it.

2. Then open the file which you are using to establish a connection:

  • sudo gedit /etc/openvpn/de75.nordvpn.com.udp1194.ovpn

And change this line:

  • auth-user-pass

into

  • auth-user-pass auth.txt

Save the file and change its name:

  • sudo mv /etc/openvpn/de75.nordvpn.com.udp1194.ovpn /etc/openvpn/de75.conf

3. Then you will have to edit the startup on boot file via this command:

  • sudo gedit /etc/default/openvpn

When the text editor opens, add this line above #AUTOSTART="all":

  • AUTOSTART="de75"

Save the file and reboot your Linux device.

4. After the reboot - open the terminal and type in:

  • sudo traceroute 8.8.8.8

The first hop address should be 10.8.8.1 and in ipleak.net you should see Germany 75 servers IP address.

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.

Related Articles