Support schedule

Monday to Friday 08:00 AM to 05:00 PM. (MET)
Please expect a maximum process time of 48 hours (during working week days)

 Most Popular
Help & FAQ: Linux Installation
Configure OpenVPN for Linux
Posted by Uli Brügmann on 25 February 2013 11:53 AM

On Linux, CyberGhost VPN can be used with a native OpenVPN installation, if the following requirements are met: OpenVPN preinstalled on your distribution, you have a Premium or Premium Plus CyberGhost subscription, an online CyberGhost account and a OpenVPN configuration file, which will be created for you in your account.

 Please note!

To see how to create an account without the CyberGhost Windows or Mac client, read this article.

Step 1

Visit your CyberGhost VPN online account.

Log-in with your user data and click in the left sided menu on the entry 'Smart Phones, Tablets & Other Devices'.

Now click on 'Other Devices'.

Right beneath, select the OpenVPN protocol as the one you want to use.

Once done select the country you want to surf from, e.g. 'USA', and the operating system you want your OpenVPN configuration for. In this case it's 'Linux'.

Note: An OpenVPN connection can just be configured with exactly one country (the server inside this country will be chosen automatically by CyberGhost as the most convenient server available). 

Now note the following data shown beneath the drop down lists. You will need this data to configure your OpenVPN connection:

  • Server: This is the address of the country you want to surf from, e.g. 'us.openvpn.cyberghostvpn.com'. Do you want to connect to different locations, select different countries and note down all addresses shown.
  • Username: This is your CyberGhost user name (account name).
  • Password: This is your CyberGhost password you use for your account (it will not be shown here).

The next step is to download the configuration file. For that please click on 'Download Configuration'.

Step 2

There are several OpenVPN software packages for different Linux platforms like RedHat, Fedora, CentOS and Ubuntu. If your Linux distribution has no OpenVPN built in and does not provide you with the appropriate package, you'll find various setup files or packages for a manual install on the OpenVPN project Website.

Note: As we all know there are seldom two Linux distribution built the same way; therefore the following instructions might be of no help for you. If that's the case, please consult the help documentation of your distribution. Furthermore the following links might also help you out:

Don't forget: You will also need to install the 'network-manager-openvpn' using Synaptic, which will help you adding and managing your various VPN connections. You may also be in need to install more and different software and consider dependencies, e.g. OpenSSL, so an open documantation on the side might come in handy.

To install OpenVPN for example with Linux Mint, open a terminal fand enter the following commands:

sudo apt-get install openvpn
sudo apt-get install openvpn bridge-utils
sudo apt-get install network-manager-openvpn network-manager-openvpn-gnome
sudo restart network-manager

Alternatively consult the respective repository of your distribution and search for OpenVPN.

If you use a RPM based distribution, go to goo.gl/MI3ndm, download the latest Tarball and type this command in a terminal: 

rpmbuild -tb openvpn-2.3.2.tar.gz (or whichever version you downloaded)

Now decompress the downloaded CyberGhost configuration file and copy it into a subfolder inside the OpenVPN 'config' folder. Call it whatever you like, 'CyberGhost' for example.

Step 3

Now use the network manager to configure your new connection - but before that, please open the downloaded 'CyberGhost.ovpn' file with a text editor, extract the following passages and copy the respective content into three new different files:

  1. Copy the section <ca> (all between <ca> and </ca>) into an empty text file and safe this file as 'ca.crt'.
  2. Copy the section <cert> (all between <cert> and </cert) into an empty text file and safe the file as 'cert.crt'.
  3. Copy the section <key> (all between <key> and </key>) into an empty text file and safe the file as 'key.key'.

Following is an example of how to configure OpenVPN with Debian 7: First, click on the network manager in the menu bar. Choose 'VPN connections > Configure VPN'.

In the tab ‘VPN’ click on 'Add'.

Choose 'OpenVPN' as the 'Connection type' and click on 'Create'.

In the next window type in a 'Connection Name', enter the server address you noted before in the field 'Gateway' and take care of the section 'Authentication'.

  • Type: Choose 'Password with certificates (TLS)'
  • User name: Your CyberGhost user name.
  • Password: Your CyberGhost password.
  • User certificate: Enter here the path to the user certification file (the above mentioned file called 'ca.crt')
  • CA certificate: Enter here the path to the CA certification file (the above mentioned file called 'cert.crt')
  • Private Key: Enter here the path to the key file (the above mentioned file called 'key.key')

 

Now click on 'Advanced' on the right bottom of the window and check all of these options (and uncheck the rest), resp. change settings:

  • Tab 'general':
    • Use custom gateway port: 9081
    • Use LZO data compression
    • Use a TAP device
    • Use custome tunnel MTU: 1500
    • Use custom UDP fragment size: 1300
  • Tab 'Security'
    • Cipher: AES-256-CBC
    • HMAC Authentification: MD-5

Back in the network manager you now should have an entry with your new OpenVPN connection.

Choose the entry via your menu ('VPN connections > Connection Name') and you're in:

 

Update

On some systems things don't work out like they should, mostly because of the network manager. If that's the case with your configuration, please try the following:

  • First of all: DON'T add a new OpenVPN connection in the network manager, but instead click on 'Import'.
  • Import the downloaded CyberGhost file
  • Proceed as described above ... 

Variant 2

Completely without network manager, therefore with OpenVPN directly, is another alternative to get stubborn configurations to work:

  • Type in 'apt-get install openvpn' in a console window
  • Copy the config file manually to '/etc/openvpn/openvpn.ovpn'
  • Type 'service openvpn start'

 

Note: For each country, you want to surf from, you need to download its own OVPN file from your account management and rename it before copying it to the mentioned folder. That means you have to go through these steps:

 

  1. Choose a country, e.g. USA
  2. Download the file
  3. Rename it from ‘CyberGhost.ovpn’ to ‘CG_USA.ovpn’.
  4. Then choose the next country, e.g. Germany
  5. Download the file
  6. Rename it to ‘CG_DE.ovpn’.
  7. etc. ...

 


 

S

 

(46 vote(s))
This article was helpful
This article was not helpful

Comments (0)
© CyberGhost VPN