maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   [HOW-TO] OpenVPN on the command line (https://talk.maemo.org/showthread.php?t=92276)

Fawz 2014-01-04 21:54

[HOW-TO] OpenVPN on the command line
 
When browsing the running services with systemctl I noticed that connman-vpn.service was running. So I checked the nemo repository and it contained an openvpn package. Turns out OpenVpn works on the Jolla from the command line! Here's how you can get it working. Note that you need to enable developer mode. This is only for connecting via the command line/terminal.

1) Copy you certificates and OpenVPN profiles to a directory on the phone. Note where that directory is.

2) Install OpenVPN.

Code:

$ devel-su
# pkcon refresh
# pkcon install openvpn

3) Move the resolv updater scripts into place and set execute permissions.

Code:

# cp /usr/share/doc/openvpn-2.2.2/contrib/pull-resolv-conf/* /etc/openvpn/.
# chmod +x /etc/openvpn/client.*

4) Modify your .ovpn config file(s) to point to the resolv updater scripts. In my case I needed to change:
Quote:

up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
to
Quote:

up /etc/openvpn/client.up
down /etc/openvpn/client.down
Either change the files before you copy them to the phone or use nano on the phone's terminal. See http://talk.maemo.org/showthread.php?t=92036 how to install nano.

5) Change to the directory containing the config files and connect. Replace where indicated with your path and config file name.
Code:

# cd <your directory path>
# openvpn <yourconfig>.ovpn

With the right username/password and configs it should now connect to the vpn.

H1777 2014-01-05 00:54

Re: [HOW-TO] OpenVPN on the command line
 
Sweet!!! Thanks for this!
Had some problems setting up, getting script-security error.
Solved by adding "script-security 2" to the .ovpn file and now it works beautifully :-)

Matti 2014-01-05 13:46

Re: [HOW-TO] OpenVPN on the command line
 
I always get:
Code:

Sun Jan  5 14:31:56 2014 /sbin/ip route add 0.0.0.0/0 via 192.168.xxxx.xxxx
RTNETLINK answers: File exists
Sun Jan  5 14:31:56 2014 ERROR: Linux route add command failed: external program exited with error status: 2

So the route gets not set up correctly. Is it because of connman-vpnd running?

Fawz 2014-01-05 16:07

Re: [HOW-TO] OpenVPN on the command line
 
Quote:

Originally Posted by Matti (Post 1403982)
I always get:
Code:

Sun Jan  5 14:31:56 2014 /sbin/ip route add 0.0.0.0/0 via 192.168.xxxx.xxxx
RTNETLINK answers: File exists
Sun Jan  5 14:31:56 2014 ERROR: Linux route add command failed: external program exited with error status: 2

So the route gets not set up correctly. Is it because of connman-vpnd running?

I have connman.service and connman-vpn.service running, both default. Everthing else is default as well excepting dev mode. Is your Sailfish up-to-date and did you do pkcon reftesh?

It might also be your config or the way it's formatted. Is it confirmed to be working?

Matti 2014-01-05 16:46

Re: [HOW-TO] OpenVPN on the command line
 
Yes, my Sailfish is up-to-date and i did a pkcon refresh. The VPN connection works, only the route is not set correctly.

nieldk 2014-01-05 17:09

Re: [HOW-TO] OpenVPN on the command line
 
Quote:

Originally Posted by Matti (Post 1403982)
I always get:
Code:

Sun Jan  5 14:31:56 2014 /sbin/ip route add 0.0.0.0/0 via 192.168.xxxx.xxxx
RTNETLINK answers: File exists
Sun Jan  5 14:31:56 2014 ERROR: Linux route add command failed: external program exited with error status: 2

So the route gets not set up correctly. Is it because of connman-vpnd running?

well, the error is that the route already exists. Do you use static IP ?

Matti 2014-01-05 18:37

Re: [HOW-TO] OpenVPN on the command line
 
Quote:

Originally Posted by nieldk (Post 1404031)
well, the error is that the route already exists. Do you use static IP ?

no, i get my ip from the dhcp server.

ukica 2016-02-04 20:36

Re: [HOW-TO] OpenVPN on the command line
 
any idea how to instal openvpn on jolla tablet ? i get this error when trying to install from terminal:

Fatal error: File './core/i486/openvpn-2.3.6-1.4.1.i486.rpm' not found on medium 'https://releases.jolla.com/releases/2.0.1.7/jolla/i486/'

Markkyboy 2016-02-05 01:24

Re: [HOW-TO] OpenVPN on the command line
 
The output you show (fatal error) suggests (to me) that openvpn is not available for the tablet, yet...I could be wrong, alternatively have a look here; https://openrepos.net/content/korppi/securefishnet

The developer is offering versions for tablet and from the write up, says it uses/downloads openvpn anyway, so I guess this is a Sailfishy UI for managing/using openvpn.

Regards,

ukica 2016-02-05 08:25

Re: [HOW-TO] OpenVPN on the command line
 
thanks I'll try that.. but based on the description it also installs openvpn from repository so not really sure if it works


All times are GMT. The time now is 01:53.

vBulletin® Version 3.8.8