I'm trying to setup OpenVPN using NetworkManager. The GUI seems buggy and unresponsive. Are there any other tools for setting up a VPN client?

share|improve this question
1  
Becareful about DNS leak of openvpn on Ubuntu. Fix: ubuntubuzz.com/2015/09/… – Xaqron Mar 18 '17 at 12:55
up vote 84 down vote accepted

Yes, you can use OpenVPN directly. This way you can use more settings as well.

First you need the openvpn package:

sudo apt-get install openvpn

Then you can connect like this:

sudo openvpn --config /path/to/config.ovpn

The sudo is important because OpenVPN won't be able to connect otherwise (I think because it has to change the routes).

share|improve this answer
    
I cannot find the config.ovpn file – Yan King Yin Apr 17 '15 at 15:18
2  
@YanKingYin You should get it from VPN service provider. – Ali Shakiba May 22 '15 at 8:48
6  
To make it permanent, edit /etc/default/openvpn and uncomment the line AUTOSTART="all" and copy your ovpn file to /etc/openvpn/config.conf - must has .conf extension – Thales Ceolin Jun 25 '15 at 21:59
2  
@YanKingYin you should be able to download it by logging to your vpn server from browser. – Aniket Thakur Jul 31 '15 at 18:21
    
and how would you stop the service cleanly, just killing the command ? – toine Dec 13 '16 at 21:02

Easiest method is running this command:

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

And then add a OpenVPN connection from Network Manager which after above command supports importing .ovpn files.

enter image description here

share|improve this answer
    
I tried using this, but couldn't save it. I think I'm affected by this bug: bugs.launchpad.net/ubuntu/+source/network-manager-applet/+bu‌​g/… – Farid Nouri Neshat Aug 2 '17 at 10:17
    
@FaridNouriNeshat: It is a while (after an update) in 16.04.1 LTS it doesn't work (I have reported the bug). Now using terminal to do that just read my comment on question about DNS leak. – Xaqron Aug 2 '17 at 11:30

As Louis has explained installing openvpn client can be done with command

sudo apt-get install openvpn

However if you are using dual authentication mechanism for your vpn server, simple connection with

sudo openvpn --config /path/to/config.ovpn

will not be sufficient. You need some extra setup.

  1. Make sure your config file has auth-user-pass line.
  2. Next add --auth-retry interact to your connection command. So your entire command would look like

    sudo openvpn --config /path/to/config.ovpn --auth-retry interact
    
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.