Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
27
rated 0 times [  27] [ 0]  / answers: 1 / hits: 56431  / 1 Year ago, wed, february 8, 2023, 5:20:53

Edit: Fixed it back then when the patch rolled out with add VPN config.
No longer use Linux/Ubuntu now.


I installed the OpenVPN Network-Manager by doing: sudo apt-get install network-manager-openvpn, which also installs the gnome package.


This made it possible to import configurations under 13.10, but on my fresh installation, I can point to the .conf files, but after clicking import, the manager just dissapears and no connection is added.


I tried manually setting it up, which kind of worked, but my connection keeps dropping after a while, I guess because I didn't manually set every last detail of the very detailed configuration.


Connecting through the terminal by doing: sudo openvpn --config /path/to/openvpn.conf asked me for a username, then password, but then doesn't connect.


What can I do to fix this?
I really need my VPN, any help is deeply appreciated.


Edit: It's a bug/1294899


For the re-open queue: Someone has an extremely good work-around for this and he used an edit to put this in, but this is worthy of its own answer: voting to re-open...


More From » gnome

 Answers
2

You're right, it is a network manager bug. But I (and you too) can get around it by running openvpn from the command line. You've probably done at least a few of these steps, but just in case (and for the benefit of others) I'll do a full step-by-step.



First install the required packages



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


Create Files
These files must be kept safe and private at all times




  1. Make a directory called openvpn in your home directory Copy your VPN
    client file (renamed client.ovpn) into directory openvpn

  2. Optional: Keep an original copy of the file – call it client.ovpn.orig

  3. Next we will create 4 files under the openvpn directory.

  4. See the bottom of this file for how to automate the following steps

  5. Open the client.ovpn file in a text editor.

  6. Create a file called ca.crt – copy the text between <ca> and </ca> from client.ovpn into this file

  7. Create a file called client.crt – copy the text between <cert> and
    </cert> from client.ovpn into this file

  8. Create a file called client.key – copy the text between <key> and </key> from client.ovpn into this file

  9. Create a file called ta.key – copy the text between
    <tls-auth> and </tls-auth> from client.ovpn into this file
    At this point I have a total of 6 files under my openvpn directory (including the backup file)



5-9 I've just worked out how to do bash script. Whoop Copy the following into a text file:



#!/bin/bash
sed '1,/<ca>/d;/</ca>/,$d' client.ovpn > ca.crt
sed '1,/<cert>/d;/</cert>/,$d' client.ovpn > client.crt
sed '1,/<key>/d;/</key>/,$d' client.ovpn > client.key
sed '1,/<tls-auth>/d;/</tls-auth>/,$d' client.ovpn > ta.key


I saved the file as openvpnconvert in the openvpn folder along with the client.ovpn file. Made it executable with the command chmod a+x:



chmod a+x openvpnconvert


And then ran it:



./openvpnconvert


Modify the client.ovpn file



Just before the ## —–BEGIN RSA SIGNATURE—– line add the below lines and save



ca ca.crt
cert client.crt
key client.key
tls-auth ta.key


Finally, you need to run openvpn from the Command Line Interface (CLI)



cd into the openvpn folder



cd openvpn


Run openvpn, if you're using the filenames I specified, see below, otherwise use your filenames.



sudo openvpn --client --config ~/openvpn/client.ovpn --ca ~/openvpn/ca.crt


I'm currently running OpenVPN, which I set up using exactly these steps. Hope it works equally well for others.



Sources:



Creating Files - http://naveensnayak.wordpress.com/2013/03/04/ubuntu-openvpn-with-ovpn-file/



Running from the Command Line - http://ubuntuforums.org/showthread.php?t=2206811


[#25896] Thursday, February 9, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
raacket

Total Points: 198
Total Questions: 114
Total Answers: 111

Location: Czech Republic
Member since Mon, May 15, 2023
1 Year ago
raacket questions
;