[solved] OpenVPN ovpn import

Post here if you are a new Porteus member and you're looking for some help.
User avatar
amplatfus
Samurai
Samurai
Posts: 153
Joined: 30 Oct 2012, 14:55
Distribution: MATE Porteus-v5.0rc1
Location: Romania

[solved] OpenVPN ovpn import

Post#1 by amplatfus » 22 Dec 2016, 16:09

Hi,
I am on Porteus LXDE x64 and I have configured a OpenVPN connection with user/ password authentication.
When I'm importing the *.ovpn file only field found filled is the gateway. I have fields remain empty for user certificate, CA certificate, Private Key.
I have tried extracting those keys from *.ovpn and put the keys into separate files but is not working. I think this is also because no user/ password fields filled.

I am still searching the solution. I'll appreciate any advice.
Many thanks,
amplatfus
Last edited by amplatfus on 21 Jul 2017, 20:44, edited 1 time in total.
Porteus-v5.0. rc1 MATE. Thank you all dev team and @Blaze for helping to configure it, thanks to entire Porteus community members for great topics.
Kernel: 000-kernel-5.4.8,xzm

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: OpenVPN ovpn import

Post#2 by brokenman » 23 Dec 2016, 03:16

Does it work from a root console if you enter the following?

Code: Select all

openvpn /path/to/my/file.ovpn
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
amplatfus
Samurai
Samurai
Posts: 153
Joined: 30 Oct 2012, 14:55
Distribution: MATE Porteus-v5.0rc1
Location: Romania

Re: OpenVPN ovpn import

Post#3 by amplatfus » 23 Dec 2016, 08:54

Thank you so much. Seems working, but I have access only to intranet. Ping to internet not working. I have to say that with the same *.ovpn file I succeed on Windows and Android. On both intranet and internet is working.

I guess is because I set up that all traffic pass through external IP from router and somehow OpenVPN from Porteus is not setting up correctly the dns.
Please, if you have a hint? Should I update the OpenVPN 2.3.2 x86_64-slackware-linux-gnu client?

Here below is the output:

Code: Select all

root@porteus:~# openvpn /root/Downloads/client.ovpn
Fri Dec 23 10:18:22 2016 OpenVPN 2.3.2 x86_64-slackware-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [eurephia] [MH] [IPv6] built on Oct 12 2013
Enter Auth Username: username
Enter Auth Password:
Fri Dec 23 10:18:34 2016 UDPv4 link local: [undef]
Fri Dec 23 10:18:34 2016 UDPv4 link remote: [AF_INET]82.78.233.127:1194
Fri Dec 23 10:18:34 2016 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Fri Dec 23 10:18:36 2016 [RT-AC88U] Peer Connection Initiated with [AF_INET]82.78.233.127:1194
Fri Dec 23 10:18:38 2016 TUN/TAP device tun0 opened
Fri Dec 23 10:18:38 2016 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Fri Dec 23 10:18:38 2016 /usr/sbin/ip link set dev tun0 up mtu 1500
Fri Dec 23 10:18:38 2016 /usr/sbin/ip addr add dev tun0 10.8.0.4/24 broadcast 10.8.0.255
Fri Dec 23 10:18:38 2016 Initialization Sequence Completed
Thank you!
Porteus-v5.0. rc1 MATE. Thank you all dev team and @Blaze for helping to configure it, thanks to entire Porteus community members for great topics.
Kernel: 000-kernel-5.4.8,xzm

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: OpenVPN ovpn import

Post#4 by brokenman » 23 Dec 2016, 21:06

Are you using ipv6?

You can test your DNS theory by manually setting the DNS.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
amplatfus
Samurai
Samurai
Posts: 153
Joined: 30 Oct 2012, 14:55
Distribution: MATE Porteus-v5.0rc1
Location: Romania

Re: OpenVPN ovpn import

Post#5 by amplatfus » 23 Dec 2016, 21:33

brokenman wrote:Are you using ipv6?
You can test your DNS theory by manually setting the DNS.
Thank you for reply, No, I am not using ipv6.
About DNS could you please advice how it can be done? I tried, but I do not found out from where it can be changed the DNS for OpenVPN connection.

Best regards,
amplatfus
Porteus-v5.0. rc1 MATE. Thank you all dev team and @Blaze for helping to configure it, thanks to entire Porteus community members for great topics.
Kernel: 000-kernel-5.4.8,xzm

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: OpenVPN ovpn import

Post#6 by brokenman » 24 Dec 2016, 19:31

I am using Porteus-v3.2.2.
To setup openvpn via networkmanager I did the following.

Make sure your .ovpn file has chmod 644. You will import this file as guest.

Code: Select all

chmod 644 /path/to/myFile.ovpn
Open a root console and add a user:

Code: Select all

groupadd -r nm-openvpn
useradd -r -g nm-openvpn -d / -s /sbin/nologin -c "Default user for running openvpn spawned by NetworkManager" nm-openvpn
Now open the connection editor as a normal user. You can do this by right clicking on the networkmanager applet.
Choose to add a new connection. You need to choose VPN but you need to import a vpn file.
Import the .opvn file you use to connect.
Add the password in the connection editor and you should be able to connect.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
amplatfus
Samurai
Samurai
Posts: 153
Joined: 30 Oct 2012, 14:55
Distribution: MATE Porteus-v5.0rc1
Location: Romania

Re: OpenVPN ovpn import

Post#7 by amplatfus » 24 Dec 2016, 19:53

OK. I followed the steps but the problem is still the same. When importing the *ovpn file the only thing imported is the gateway and connection name. User Certificate, CA Certificate, Private Key are empty. Also no field found for enter user/ password. I post below the terminal log and the VPN window screen. I am on LXDE x64, Porteus-v3.0.1, Kernel: 3.14.15.

The same *ovpn works from Windows and from Android.

Code: Select all

root@porteus:~/Downloads# chmod 644 client1.ovpn
root@porteus:~/Downloads# groupadd -r nm-openvpn
root@porteus:~/Downloads# useradd -r -g nm-openvpn -d / -s /sbin/nologin -c "Default user for running openvpn spawned by NetworkManager" nm-openvpn
VPN NetworkManager after entered commands from terminal and *ovpn import.
Image

Many thanks!
Porteus-v5.0. rc1 MATE. Thank you all dev team and @Blaze for helping to configure it, thanks to entire Porteus community members for great topics.
Kernel: 000-kernel-5.4.8,xzm

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: OpenVPN ovpn import

Post#8 by brokenman » 24 Dec 2016, 20:03

I am on LXDE x64, Porteus-v3.0.1, Kernel: 3.14.15.
I'm afraid I can only support v3.2+ for now.

If DNS was your problem then you can manually set this in networkmanager in the settings to 8.8.8.8 and 8.8.4.4 (plenty of online tutorials) and then try to start your vpn again via root terminal.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
amplatfus
Samurai
Samurai
Posts: 153
Joined: 30 Oct 2012, 14:55
Distribution: MATE Porteus-v5.0rc1
Location: Romania

Re: OpenVPN ovpn import

Post#9 by amplatfus » 24 Dec 2016, 20:08

brokenman wrote:
I am on LXDE x64, Porteus-v3.0.1, Kernel: 3.14.15.
I'm afraid I can only support v3.2+ for now.

If DNS was your problem then you can manually set this in networkmanager in the settings to 8.8.8.8 and 8.8.4.4 (plenty of online tutorials) and then try to start your vpn again via root terminal.
Many thanks for help and for entire work for Porteus. All the best and Merry Christmas to all!
Porteus-v5.0. rc1 MATE. Thank you all dev team and @Blaze for helping to configure it, thanks to entire Porteus community members for great topics.
Kernel: 000-kernel-5.4.8,xzm

User avatar
amplatfus
Samurai
Samurai
Posts: 153
Joined: 30 Oct 2012, 14:55
Distribution: MATE Porteus-v5.0rc1
Location: Romania

[solved] Re: OpenVPN ovpn import

Post#10 by amplatfus » 21 Jul 2017, 20:43

brokenman wrote:I am using Porteus-v3.2.2.
To setup openvpn via networkmanager I did the following.

Make sure your .ovpn file has chmod 644. You will import this file as guest.

Code: Select all

chmod 644 /path/to/myFile.ovpn
Open a root console and add a user:

Code: Select all

groupadd -r nm-openvpn
useradd -r -g nm-openvpn -d / -s /sbin/nologin -c "Default user for running openvpn spawned by NetworkManager" nm-openvpn
Now open the connection editor as a normal user. You can do this by right clicking on the networkmanager applet.
Choose to add a new connection. You need to choose VPN but you need to import a vpn file.
Import the .opvn file you use to connect.
Add the password in the connection editor and you should be able to connect.
Thank you. I can confirm that on XFCE after entering like you advice it worked. Many thanks. Hope it will help other too!
PS: it worked even with root user
amplatfus
Porteus-v5.0. rc1 MATE. Thank you all dev team and @Blaze for helping to configure it, thanks to entire Porteus community members for great topics.
Kernel: 000-kernel-5.4.8,xzm

Post Reply