You are not logged in.

#1 2017-03-29 08:46:28

mindless
Member
Registered: 2017-01-21
Posts: 29

[SOLVED] OpenVPN setup with many .ovpn files

Let met apologize if I'm not clear enough, I'm a newbie and especially in networking..

I am currently subscribing to a vpn provider which provides multiples servers in tcp/udp.

For each server and each protocol, I have an ovpn file and I have also a pem file (which I think is the same for every servers ?).

Up to now, I was used to setup my vpn this way

  • Open the network manger

  • Import vpn from config file

  • Choose the ovpvn file

  • Specify username, password and pem file

And each time I want to switch server/protocol, I choose another vpn connection in the network manager.

It's working great, but I would like to autotomize this setup because I don't want to specify all the servers using the network manager gui, and it would be great if I could not use the network manager at all.

I have readed the Archlinux OpenVPN configuration page, and as I understood, I have to create a .conf file in /etc/openvpn/client/ for each servers. Could I just put my ovpn files ?

Moreover, I would like to use a gui to switch easily between different servers, I noticed QOpenVPN which seems to be great but I don't know how to use it, there isn't any doc. I scroll through the code and noticed that it was using systemctl openvpn@[client].service so I guess it relates to the conf files ?

Any lead or any link will be very helpfull smile

Last edited by mindless (2017-03-30 07:10:07)

Offline

#2 2017-03-29 09:02:17

smirky
Member
From: Bulgaria
Registered: 2013-02-23
Posts: 277
Website

Re: [SOLVED] OpenVPN setup with many .ovpn files

Well, first, you should forget about the .ovpn file extension, as you probably already noticed, it's a .conf file for the Linux client.
In /etc/openvpn/client, you can simply add all the client .conf files you like. As for the requirements for them to work, such as certificates and other stuff, I'd personally structure them in separate folders, inside the openvpn/client dir.
Example:

/etc/openvpn/client/
/etc/openvpn/client/vpn_one.conf
/etc/openvpn/client/vpn_two.conf
/etc/openvpn/client/vpn_three.conf
/etc/openvpn/client/vpn_one/
/etc/openvpn/client/vpn_one/vpn_one.crt
/etc/openvpn/client/vpn_one/vpn_one.key
/etc/openvpn/client/vpn_two/
/etc/openvpn/client/vpn_two/vpn_two.crt
/etc/openvpn/client/vpn_two/vpn_two.key
/etc/openvpn/client/vpn_three/
/etc/openvpn/client/vpn_three/vpn_three.crt
/etc/openvpn/client/vpn_three/vpn_three.key

Then simply enable them and start them:

# systemctl enable openvpn-client@vpn-one openvpn-client@vpn-two openvpn-client@vpn-three
# systemctl start openvpn-client@vpn-one openvpn-client@vpn-two openvpn-client@vpn-three

Assuming the .conf files are set correctly, that's all you need.


Personal spot  ::  https://www.smirky.net/  ::  Try not to get lost!

Offline

#3 2017-03-29 10:50:43

mindless
Member
Registered: 2017-01-21
Posts: 29

Re: [SOLVED] OpenVPN setup with many .ovpn files

Ok thanks a lot, I will have a look to create the conf files automatically. I saw openvpn --config ovpnfile but didn't read the doc yet.
Also, the last commands you ran, does it makes the three vpn running simultaneously ?

Offline

#4 2017-03-29 10:55:46

smirky
Member
From: Bulgaria
Registered: 2013-02-23
Posts: 277
Website

Re: [SOLVED] OpenVPN setup with many .ovpn files

Yes, it does. It's up to you to choose how you want to start them and what to trigger that.
I think there's plenty of software that can serve as an openvpn GUI.

Last edited by smirky (2017-03-29 10:56:30)


Personal spot  ::  https://www.smirky.net/  ::  Try not to get lost!

Offline

#5 2017-03-29 14:10:38

mindless
Member
Registered: 2017-01-21
Posts: 29

Re: [SOLVED] OpenVPN setup with many .ovpn files

Yes or I can even do it myself. Thank you smirky smile If you have any idea of how to convert ovpn to conf, I would like to hear it.

Offline

#6 2017-03-29 14:48:01

smirky
Member
From: Bulgaria
Registered: 2013-02-23
Posts: 277
Website

Re: [SOLVED] OpenVPN setup with many .ovpn files

$ mv file.ovpn file.conf

Personal spot  ::  https://www.smirky.net/  ::  Try not to get lost!

Offline

#7 2017-03-29 14:51:23

hcjl
Member
From: berlin
Registered: 2007-06-29
Posts: 330

Re: [SOLVED] OpenVPN setup with many .ovpn files

smirky wrote:
$ mv file.ovpn file.conf

mv is really the best converter I've every used. It nearly converts everything;-)

scnr

Offline

#8 2017-03-29 18:03:01

mindless
Member
Registered: 2017-01-21
Posts: 29

Re: [SOLVED] OpenVPN setup with many .ovpn files

If I knew that that was working x) Thanks

Offline

#9 2017-03-30 05:10:10

smirky
Member
From: Bulgaria
Registered: 2013-02-23
Posts: 277
Website

Re: [SOLVED] OpenVPN setup with many .ovpn files

Make sure to mark your thread as solved smile


Personal spot  ::  https://www.smirky.net/  ::  Try not to get lost!

Offline

Board footer

Powered by FluxBB