Candela Technologies Logo
Network Testing and Emulation Solutions

Configuring OpenVPN on Ubuntu

Goal: Connect your laptop to a VPN with the provided keys and configuration file.

Connecting to the office network remotely requires you to install the openvpn package and place the config files in the correct places. You can start and stop the VPN using simple commands at a terminal.
  1. Install OpenVPN

  2. Open a terminal and see if you already have openvpn installed:
    $ which openvpn
    This means you have OpenVPN installed.
  3. Installing openvpn is a simple command:
     $ sudo apt install openvpn
  4. Add your Config Files

  5. You should be provided with these files:
    1. your-laptop.key ← This is your private key
    2. your-laptop.crt ← This is your certificate
    3. ca.crt ← This is the VPN server certificate
    4. candelatech.conf ← The config file for the connection
    You will place these files in /etc/openvpn. The files should be owned by root, so become root and copy them with this technique:
     $ sudo -s
    [/home/amelia] # cd /etc/openvpn
    [/etc/openvpn] # cp ~amelia/Downloads/your-laptop.key .
    [/etc/openvpn] # cp ~amelia/Downloads/your-laptop.crt .
    [/etc/openvpn] # cp ~amelia/Downloads/ca.crt .
    [/etc/openvpn] # cp ~amelia/Downloads/candelatech.conf .
  6. Starting and Stoping the VPN Connection

  7. In a terminal, cd to /etc/openvpn and start the connection as root:
     $ cd /etc/openvpn
    $ sudo openvpn candeltech.conf
    Press Control-C in that window to stop the VPN connection.
  8. Example Config File

  9. client
    dev tun1
    proto udp
    remote 1194
    #remote 443
    script-security 2
    resolv-retry infinite
    verb 3
    ca ca.crt
    cipher AES-256-CBC

Candela  Technologies, 2417 Main Street, Suite 201, Ferndale, WA 98248, USA | | +1.360.380.1618
Facebook | LinkedIn | Blog