Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Check the client status 

    Code Block
    user@user-desktop:~$ sudo service openvpn@client status
    ● openvpn@client.service - OpenVPN connection to client
       Loaded: loaded (/lib/systemd/system/openvpn@.service; disabled; vendor preset: enabled)
       Active: inactive (dead)
         Docs: man:openvpn(8)
               https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage
               https://community.openvpn.net/openvpn/wiki/HOWTO
    user@user-desktop:~$ sudo service openvpn@client start
    user@user-desktop:~$ sudo service openvpn@client status
    ● openvpn@client.service - OpenVPN connection to client
       Loaded: loaded (/lib/systemd/system/openvpn@.service; disabled; vendor preset: enabled)
       Active: active (running) since Fri 2017-01-06 10:15:36 CET; 1s ago
         Docs: man:openvpn(8)
               https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage
               https://community.openvpn.net/openvpn/wiki/HOWTO
      Process: 16943 ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status 10 --cd /etc/openvpn --script-security 2 --config /etc
     Main PID: 16945 (openvpn)
       CGroup: /system.slice/system-openvpn.slice/openvpn@client.service
               └─16945 /usr/sbin/openvpn --daemon ovpn-client --status /run/openvpn/client.status 10 --cd /etc/openvpn --script-security 2 --config /etc
    
    Jan 06 10:15:36 user-desktop systemd[1]: Starting OpenVPN connection to client...
    Jan 06 10:15:36 user-desktop ovpn-client[16945]: Control Channel Authentication: tls-auth using INLINE static key file
    Jan 06 10:15:36 user-desktop systemd[1]: openvpn@client.service: PID file /run/openvpn/client.pid not readable (yet?) after start: No such file or d
    Jan 06 10:15:36 user-desktop ovpn-client[16945]: Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
    Jan 06 10:15:36 user-desktop systemd[1]: Started OpenVPN connection to client.
    Jan 06 10:15:36 user-desktop ovpn-client[16945]: Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
    Jan 06 10:15:36 user-desktop ovpn-client[16945]: Socket Buffers: R=[163840->200000] S=[163840->200000]
    Jan 06 10:15:36 user-desktop ovpn-client[16945]: UDPv4 link local: [undef]
    Jan 06 10:15:36 user-desktop ovpn-client[16945]: UDPv4 link remote: [AF_INET]54.93.195.156:1194


  • You should now see a new interface come up with a VPN IP address

    Code Block
    root@ubuntu:ifconfig
    tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
              inet addr:172.27.230.24  P-t-P:172.27.230.24  Mask:255.255.248.0
              UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:100 
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


Disable Autostart

Sometimes you want to disable autostart, because VPN will be switched on through an action.

Edit the openvpn default config file.


Code Block
user@ubuntu:~$ sudo gedit /etc/default/openvpn


And uncomment the line:

Code Block
#AUTOSTART="none"