Linux openvpn import ovpn

How to setup VPN using an .ovpn file? [duplicate]

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?

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.

2 Answers 2

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.

Thanks! You made my day! Just a question: why is pptp supported by default, but does openvpn support need to be installed seperately?

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.

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.

I’ve had trouble importing .ovpn files as well. It seems to work on some machines and not others. However, it is not difficult to set up the connection using Network Manager. Many critical settings are only accessed after you click on the «Advanced» button, perhaps you didn’t look there.

Example Tick "all users may connect to this network" Set connection name Set server name in Gateway box Set type to Certificates (TLS) Import user certificate XXX.crt Import ca certificate YYY.crt Import private key ZZZ.key Tick use LZO data compression Tick set virtual device type, TUN name tun 

If you have other settings look through the tabs to find them.

Источник

Connecting to Access Server with Linux

Connecting to OpenVPN Access Server from Linux requires a client program. It will capture the traffic you wish to send through the OpenVPN tunnel, encrypting it and passing it to the OpenVPN server. And of course, the reverse, to decrypt the return traffic.

Linux Packages Discussed

OpenVPN Access Server openvpn-as
OpenVPN 3 Linux Client openvpn3
OpenVPN open source openvpn

OpenVPN 3 Linux Client

The OpenVPN 3 Linux project is a new client built on top of the OpenVPN 3 Core Library. This client is the official OpenVPN Linux Client program. You can find an overview of the features, frequently asked questions, and instructions on installing the openvpn3 package on our OpenVPN 3 for Linux site.

Читайте также:  Linux кто создает дистрибутивы

After following the instructions there to install the client, you’ll need a connection profile. This is a file generated by your OpenVPN Access Server installation for your specific user account. It contains the required certificates and connection settings. Go to the Client web interface of your Access Server (the main address, not the /admin portion). Log in with your user credentials. You will be shown a list of files available to download. Pick the user-locked profile or the auto-login profile, and you will be sent a client.ovpn file. Save this file to your Linux operating system.

Once you’ve moved the file to your Linux system, you can import it.

openvpn3 config-import —config $

You can start a new VPN session:

openvpn3 session-start —config $

You can manage a running VPN session:

And so on. More details can be found here: OpenVPN3Linux.

OpenVPN open source OpenVPN CLI program

The open source project client program can also connect to the Access Server. The package is available in most distributions and is known simply as openvpn. It supports the option to connect to multiple OpenVPN servers simultaneously, and it comes with a service component that can automatically and silently start any auto-login profiles it finds in the /etc/openvpn folder, even before a user has logged in. This service component can be set to automatically start at boot time with the tools available in your Linux distribution if supported. On Ubuntu and Debian, when you install the openvpn package, it is automatically configured to start at boot time.

To install the OpenVPN client on Linux, it is possible in many cases to just use the version that is in the software repository for the Linux distribution itself. If you run into any connectivity problems when using outdated software, it may be due to a possible lack of support for higher TLS versions in older versions of OpenVPN. Follow the instructions found on the open source openvpn community wiki if you wish to install the OpenVPN client on your Linux system.

After installing, you will need a connection profile. This is a file generated by your OpenVPN Access Server installation for your specific user account. It contains the required certificates and connection settings. Go to the Client web interface of your Access Server (the main address, not the /admin portion). Log in with your user credentials. You will be shown a list of files available to you for download. Pick the user-locked profile or the auto-login profile, and you will be sent a client.ovpn file. Save this file to your Linux operating system somewhere. OpenVPN Access Server supports server-locked, user-locked, and auto-login profiles, but the OpenVPN command line client is only able to connect with user-locked or auto-login connection profiles.

We are assuming you are going to start the connection through either the command line as a root user, or via the service daemon. If you want unprivileged users to be able to make a connection, take a look at the community wiki for more information on how to implement that. Here we are going to focus on the simplest implementation; run the connection as root user directly, or via the service daemon.

Читайте также:  Установка 3g модема astra linux

Start a connection with an auto-login profile manually:

openvpn --config client.ovpn

Start a connection with a user-locked profile manually:

openvpn --config client.ovpn --auth-user-pass

If you use Google Authenticator or another extra factor authentication, add the auth-retry parameter:

openvpn --config client.ovpn --auth-user-pass --auth-retry interact

To start an auto-login connection via the service daemon, place client.ovpn in /etc/openvpn/ and rename the file. It must end with .conf as file extension. Ensure the service daemon is enabled to run after a reboot, and then simply reboot the system. The auto-login type profile will be picked up automatically and the connection will start itself. You can verify this by checking the output of the ifconfig command; you should see a tun0 network adapter in the list.

One major feature that is missing with the command line client is the ability to automatically implement DNS servers that are pushed by the VPN server. It is possible, but it requires you to install a DNS management program such as resolvconf or openresolv, and it may or may not clash with existing network management software in your OS. The idea here, however, is that you use a script that runs when the connection goes up, and when it goes down, that uses resolvconf or openresolv to implement the DNS servers for you. The reason why this client is not able to manage it completely by itself is mainly because in an operating system like Windows, Macintosh, Android, or iOS, there is already an established single method of handling DNS management. It is therefore easy for us to create a software client for those operating systems that already knows how to handle DNS. But Linux is available in so many variations and also supports different programs and methods of implementing DNS servers, and so it was only reasonable to leave built-in DNS support out of the OpenVPN program and instead to provide, where possible, a script that handles DNS implementation. Such a script could even be written by yourself to do whatever tasks are necessary to implement the DNS servers in your unique situation.

Fortunately on Ubuntu and Debian, for example, there is the /etc/openvpn/update-resolv-conf script that comes with the openvpn package that handles DNS implementation for these operating systems. You need only to activate the use of these by following the instructions:

Open your client.ovpn file in a text editor:

At the very bottom simply add these lines:

script-security 2 up /etc/openvpn/update-resolv-conf down /etc/openvpn/update-resolv-conf

The first line enables the use of external scripts to handle the DNS implementation tasks. The up and down lines are there to implement DNS servers pushed by the VPN server when the connection goes up, and afterwards to undo it, when the connection goes down.

Читайте также:  Linux amd ryzen 3 3200u

Ubuntu network management program

There is also the option of connecting through the GUI using the openvpn extension for the Gnome network manager plugin. But this is currently a bit tricky to set up. There is for example the incorrect assumption that all VPNs will be able to redirect Internet traffic, and older versions might not understand the .ovpn file format, requiring you to split up the certificate embedded in it into separate file. And you would likely have to dig into the options to ensure that a default Internet traffic route going through the VPN server is not always enabled by default, especially for servers where you only give access to some internal resources, and not the entire Internet. However the advantage of using the GUI component is that you can start/stop the connection from the desktop environment on Linux.

Источник

How to import .ovpn File into Ubuntu over Open VPN

A lot of VPN services including IP Vanish use .ovpn file to get open vpn configured over the linux. If you are using Ubuntu then the installation and configuration procedure of the IPVanish has been mentioned well over their website. You can follow the guide and can install the VPN connection correctly in your system. But there is a glitch, in the latest builds of the Open VPN the import option is just not present there, which stops you from importing the configuration file.

I’ll go step by step, showing first how to install Open VPN over ubuntu. And then how to get the import option of the VPN configuration file back into ubuntu.

How to Install Open VPN in Ubuntu:

You need to open up the terminal. The terminal can be found through the help of the below screenshot.

open vpn search ubuntu

Click on the Terminal and run the following command:

sudo apt-get install network-manager-openvpn

This command is going to seek your password. Write down your account password and hit enter. After this Open VPN will be installed but this will not allow you to import the configuration. Provided by famous VPN providers.

Learn how to Import OVPN File into the Open VPN in Ubuntu:

The real part comes now, here again you need to launch the terminal as told in the first step while you were installing Open VPN.

In the terminal you need to run the command:

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

This command upon hitting enter will also seek your password. But this will install complete gnome package for the Open VPN. Now you may try to configure the open vpn and this time you’ll be able to get it properly configured with import option available.

Configure Open VPN

Add Import File Open VPN

Import Saved VPN Configuration Open VPN

By following the procedure shown above in the screenshots, you now must be able to get the option to import the configuration file. This also helps you add up other options with VPN profiles.

Источник

Оцените статью
Adblock
detector