How to connect to OpenVPN Server on Ubuntu 16.04 via Network Manager

On my previous tutorial, I have shown how to install OpenVPN Server on Debian 9 Stretch. Now, I will show you how to connect to OpenVPN Server on Ubuntu 16.04, Ubuntu 17.04 and all derivatives via Network Manager. Also, I will show you how to connect to OpenVPN Server via Terminal. If you are comfortable with Terminal, you can do the following to connect to remote OpenVPN Server.

Via Terminal

First, we need to install openvpn client package on Ubuntu

sudo apt install openvpn

Next, make sure you have downloaded the .ovpn configuration file from the OpenVPN Server. On this example, my file called debian-openvpn.ovpn

sudo openvpn --config debian-openvpn.ovpn

Make sure you see the following message on Terminal, Initialization Sequence Completed. This mean, you are connected to the OpenVPN Server.

...
Mon Jul 17 14:29:13 2017 /sbin/ip link set dev tun0 up mtu 1500
Mon Jul 17 14:29:13 2017 /sbin/ip addr add dev tun0 10.8.0.2/24 broadcast 10.8.0.255
Mon Jul 17 14:29:13 2017 /sbin/ip route add 139.59.105.37/32 via 192.168.0.1
Mon Jul 17 14:29:13 2017 /sbin/ip route add 0.0.0.0/1 via 10.8.0.1
Mon Jul 17 14:29:13 2017 /sbin/ip route add 128.0.0.0/1 via 10.8.0.1
Mon Jul 17 14:29:13 2017 Initialization Sequence Completed

Via Network Manager

If you prefer using GUI to connect to the OpenVPN, you will need to install the following packages:

sudo apt-get install network-manager-openvpn-gnome openvpn

Now open Network Manager and click Add button.

Select Import a saved VPN Configuration and click Create. Then, browse your .ovpn and it will automatically read the configuration on the file.

Click Save to save the connection. Now, you can connect to the openvpn server

1 Trackback / Pingback

  1. CentOS Tutorial - How to install OpenVPN Server on CentOS 7.3

Leave a Reply