How to setup VPN using an .ovpn file?

51,638

You have to install a few packages first with:

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

then, restart network-manager

sudo service network-manager restart

and try again. If it doesn't work, then try logging out and back in, if not, then try rebooting.

Share:
51,638

Related videos on Youtube

kramer65
Author by

kramer65

Updated on September 18, 2022

Comments

  • kramer65
    kramer65 over 1 year

    I've been using Ubuntu 18.04 for about 3 days now and so far it runs smoothly. I now need to install a VPN for my work, and I got the following files from the sysadmin:

    • ca.crt
    • VPNConfig.ovpn

    I first ran sudo apt install openvpn. After that I wanted to install it using the GUI. So I went to the settings app and under "Network" I tried adding a new VPN. It gives the option to "Import from a file". So I selected the VPNConfig.ovpn file, but it says it can't import the file. I also tried importing the ca.crt file and importing the zip in which the two files came, but that didn't work either.

    Could anybody help me out as to how I can make this VPN work?

    • NerdOfCode
      NerdOfCode about 6 years
      All you have to run is openvpn --config openvpn_profile_here
    • NerdOfLinux
      NerdOfLinux about 6 years
      OP states that they want to use the GUI
    • HenrikB
      HenrikB over 5 years
      I found that one can import a *.ovpn file into the GUI using sudo nmcli connection import type openvpn file /path/to/foo.ovpn. Couldn't post an answer here, but see my answer to 'How to setup OpenVPN Client' for more details.
    • deckoff
      deckoff over 5 years
      Totally disagree that this is a duplicate - a lot have changed since 1404.Especially in the GUI!
    • muru
      muru over 3 years
      If the GUI has changed, post an updated answer on the dupe.
  • kramer65
    kramer65 about 6 years
    Thanks! You made my day! Just a question: why is pptp supported by default, but does openvpn support need to be installed seperately?
  • NerdOfLinux
    NerdOfLinux about 6 years
    I don't know. I guess the Ubuntu team decided that not enough people use it to make it worth being part of the standard OS.
  • kramer65
    kramer65 over 5 years
    For a long time it didn't work for me, even though it worked from the command line. Finally I disabled ipv6 in the GUI and then it worked. Maybe this also helps other people.