OSMC PPTP Client Configuration

Hello OSMC Community!

I’m trying to setup VPN on on my RaspberryPi 1B with latest OSMC build following this tutorial: http://blog.andrewpike.co.uk/osmc-pptp-client-configuration/

I think all is fine until I try to route all traffic through VPN - I cannot ping google.com or it’s IP address (216.58.209.46) and basically the VPN does not work.

Here’s my routing table before starting the tunnel:

osmc@osmc:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
8.8.4.4         192.168.0.1     255.255.255.255 UGH   0      0        0 eth0
8.8.8.8         192.168.0.1     255.255.255.255 UGH   0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.0.1     0.0.0.0         255.255.255.255 UH    0      0        0 eth0

and after starting the tunnel and executing: sudo route add default dev ppp0 it looks like this:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
8.8.4.4         192.168.0.1     255.255.255.255 UGH   0      0        0 eth0
8.8.8.8         192.168.0.1     255.255.255.255 UGH   0      0        0 eth0
10.0.0.1        0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.0.1     0.0.0.0         255.255.255.255 UH    0      0        0 eth0

here’s ifconfig output after starting the tunnel and routing all traffic through vpn:

osmc@osmc:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:e9:a2:03
  inet addr:192.168.0.101  Bcast:192.168.0.255  Mask:255.255.255.0
  inet6 addr: fe80::ba27:ebff:fee9:a203/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST DYNAMIC  MTU:1500  Metric:1
  RX packets:3596 errors:0 dropped:0 overruns:0 frame:0
  TX packets:2583 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000
  RX bytes:545897 (533.1 KiB)  TX bytes:374666 (365.8 KiB)

lo        Link encap:Local Loopback
  inet addr:127.0.0.1  Mask:255.0.0.0
  inet6 addr: ::1/128 Scope:Host
  UP LOOPBACK RUNNING  MTU:65536  Metric:1
  RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:0
  RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

ppp0      Link encap:Point-to-Point Protocol
  inet addr:10.9.27.68  P-t-P:10.0.0.1  Mask:255.255.255.255
  UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1496  Metric:1
  RX packets:6 errors:0 dropped:0 overruns:0 frame:0
  TX packets:126904 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:3
  RX bytes:60 (60.0 B)  TX bytes:58293431 (55.5 MiB)

I never had any problems with setting this up on Raspbmc. It’s my 3rd attempt to get it working on OSMC and still no luck. I’ll appreciate any help!

You need to enable ip_forward like this:

/bin/echo 1 > /proc/sys/net/ipv4/ip_forward

or in
nano -w /etc/sysctl.conf

Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1

-H

Thanks - I edited /etc/sysctl.conf and enabled the changes with sysctl -p /etc/sysctl.conf. Then I restarted the device to be extra sure the changes are applied.

Unfortunately, it didn’t solve the problem.
Any suggestion where to dig in?

I’m wondering how ConnMan works with PPTP client - could this be a possible source of the problem?

The issue I have is definitely related to ConnMan. Here is what I did to prove it and get the PPTP client to work:

I disabled Connection Manager with:
systemctl disable connman.service

and installed Network Manager with:
sudo apt-get install network-manager

then I edited /etc/network/interfaces - added my network config:

iface eth0 inet static
address 192.168.0.101
netmask 255.255.255.0
gateway 192.168.0.1

after these changes my PPTP client started working correctly.

Now my question to developers (@sam_nazarko and @DBMandrake) is: will this setup work long term, or will I have any problems?

I’d really love to see the PPTP client work with ConnMan, but I’m rather a beginner in linux world, so if someone can guide me, I can continue troubleshooting the connman and my pptp setup.

This will cause unexpected behaviour and we can’t recommend this. It would be much better to work out what the issue is with ConnMan and resolve that.

Sam

Totally agree! - where can I officially report this issue, so it can be tracked and doesn’t get lost?

btw - it seems that connman is causing various issues for other users trying to establish VPN connection (ex. this thread on OpenVPN)

HI again,

To be sure that the changes are used try this command, and if it say’s “1” then its used…:

cat /proc/sys/net/ipv4/ip_forward

this command is not helping you :wink: , pptp does this on it’s own.
“sudo route add default dev ppp0”
there should be no need.

i think your problem is that you have set this up like it was on the internet and having/using the same IP as the server(that need iptabels for forwarding), you should give it it’s now range for pptp.

here is my pptp.conf:

localip 10.0.1.126
remoteip 10.0.1.100-200

all in all i don’t think this is a problem with either OSMC or connman.

if you want more help please add your pptp.conf file and pptpd-options file.

-H

Thanks for your help - however, I don’t have these files you ask for in /etc/ppp - these are the files I have:
chap-secrets ip-down.d ip-up.d ipv6-down.d ipv6-up.d options.pptp peers ip-down ip-up ipv6-down ipv6-up options pap-secrets

Please note, that I don’t have my own VPN server - I’m just trying to connect to remote service (hideipvpn.com)

ohh okay my bad @sew did not see it was a client problem…

i will see if i can connect myself from OSMC to pptp, and get back to you…

-H

I think the issue is that ConnMan keeps modifying the routing table. After establishing the VPN connection and executing the following command (to route all traffic through VPN): sudo route add default dev ppp0 I end up with two default routes, right?:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0

ConnMan’s wispr will regularly modify the routing table.

Sam

Did this ever get a solution?

I just got SSTP-client installed yesterday (for having never used linux before that was quiet a project).
It seems to get a local ip on my home network and I can see on my windows server that it’s connected. However I have the same problem as above, can’t access anything on the network, can’t ping either outside the network or other devices on the network. So I take it it’s the routing probelm mentioned above but it seems the thread just died out.

Is there a solution for this?

Configure PPTP via ConnMan, and you won’t have any routing problems.

Well I’m only interested in SSTP and not PPTP therefore the usage of the SSTP-client.

My windows server with the VPN server side only runs with SSTP for the security reaons, and I like that it uses the 443 port which will be accessible from most places.

So I’m still very much interested in a workaround… :slight_smile:

When using the SSTP-client, if I go into systeminfo within Kodi and then network I see the correct ip-adress (VPN), correct subnet, but the gateway is completely empty. I take it this is the problem but I don’t know how to fix so the gateway is to my home router?

(What frustrates me is the fact that I only need the VPN so I can stream live-tv from my vu+/enigma2 box over secure https. The VU+ PVR add on has this option to enable https but it doesn’t work. I wrote a post here on this: Openwebif + KODI VU+/PVR addon fails HTTPS - [EN] Third-Party Development - Forums )