[UBUNTU] How to run an OpenVPN client through SystemD/systemctl

IMPORTANT: you must have an existing openvpn config (.ovpn) to use the information here. If you do not have one please see another guide for setting up an openvpn server / client configuration first.

  1. First install Openvpn with:

    # apt install openvpn
    
  2. Next we should check that your .ovpn configuration is working:

    # openvpn --config /path/to/your/client.ovpn
    

    If this has errors please stop this guide and fix the errors before continuing.

  3. Now we just need to move our config to /etc/openvpn

    # mv /path/to/your/client.ovpn /etc/openvpn/client.conf
    
  4. Now the config is in the default location, we can start the systemd service!

    # systemctl start openvpn@client.service
    
  5. To confirm this is working we should see a TUN interface when looking at the output of the below command:

    # ip addr show
    

You May Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *