cannot import saved openVPN configuration file in Ubuntu 16.04 LTS
I am trying to import a .ovpn
file from the network manager.
Here are the steps I follow.
Network Manager → VPN Connections → configure VPN
This opens the Network Connections dialogue. Then,
Add → import saved vpn configuration → choose
.ovpn
file
This should load my .ovpn
configuration, but instead I get a prompt saying
ERROR: plugin does not support import capability.
I can still use VPN using the command
sudo openvpn --config ~/openvpn/xxx.conf
is this a bug that needs to be filed?
I know this is an old question but since I still couldn't find an (easy) answer I want to help others (and future me).
Use this
sudo nmcli connection import type openvpn file FILE_NAME
offcourse replace FILE_NAME with the full path to your file name
This will tell you exactly what's wrong with the file and which lines you should edit/delete.
After you edited the file with the recommendations the command gave you. You can import the file.
On commenting out the following line with #
, I was able to successfully import the VPN config:
#route remote_host 255.255.255.255 net_gateway default
Others have reported that commenting out, or removing, this line works for them as well per bug #606365 in launchpad in spite of this being a valid argument.
That said, while I'm able to successfully connect to the VPN, I'm not able to hit any host over the VPN. On trying to manually set these values using the network manager GUI, I see that only numerical IP addresses are accepted. String values like remote_host or net_gateway cannot be entered via the GUI.
I've also had success importing the same .OVPN file without any modification in Fedora 23, Windows 10 (using Viscosity), OS X El Capitan (using Viscosity) and earlier versions of Ubuntu. Something is definitely broken in 16.04.
worked for me:
sudo apt install network-manager-openvpn-gnome
- open your .ovpn file with any editor
-
add # to the beginning of this line to comment it out
route remote_host 255.255.255.255 net_gateway default
Go to IPv4 settings > routes > Check the option “Use this connection only for resources on its network” > press OK > Save
Done!
This is just a wrap up of what worked for me on ubuntu 16.04 based on the other answers and comments here.