OpenVPN will not work

I live in Germany and would like to watch danish televison, that is geoblocked in Germany. My daughter lives in Kopenhagen and I got a config.ovpn from her, that allows me to join her net and thatway watch the live-programs online. If I do it on my ubuntu-computer everything works perfectly fine with the command
openvpn --config config.ovpn
and I can watch live-TV in Danmark.
Thought I can do that too with my raspberry, so I log onto the raspberry from my computer via ssh , then start openvpn with the same command, after transferring the ovpn-File onto the Pi. Everything seems to be fine. If I check the IP of the Raspberry in the danish net with curl http://checkip.dyndns.org I get to see the IP, that the router in Denmark has got.
But when I start the Add-on danish-Live-TV I get the message, that I obviously are not in Danmark. Looks like this Add-on doesn’t go through the tunnel.
I have although installed the script for the programm-addon for OpenVPN und configured it, do use this config.ovpn. OpenVPN gets started, no errormessages at all, but I am still geoblocked.

Do I need to to something to tell OSMC to use the tunnel?

Thanks for help

Jürgen

Hi. Before going into the openvpn configuration and other technical details, would you explain how you access Danish live TV from Ubuntu? Are you running Kodi on Ubuntu, as well, or do you simply use a browser?

It’s probably also worth mentioning that there are various checks that can be used to detect the use of a VPN and it’s possible that one of these checks is showing, for example, that you’re using Kodi on a VPN. They might automatically reject such connections.

Hi dillthedog

You wrote

No. In Ubuntu I access danish Live-TV via browser. If OpenVPN ist stopped, I also get the message, that Live-TV is blocked. After starting OpenVPN I have no problems.

Where do I find those ‘checks’? Can you tell me a name or names for add-ons, that I can use to check the VPN?

Thanks a lot for answering.

Jürgen

I think he means the Danish company may be checking for the presence of VPN

So we actually have two very different methods for accessing Danish TV: by browser and by Kodi add-on.

The checks would done by Danish TV., if they did them at all. There are many things that they can look at to see if a VPN is being used, some of which you can disguise and some which you can’t. A simple example: they might check if the default language on the machine is Danish and what the ping time is. Here is a site that can often see if you’re using openvpn. http://witch.valdikss.org.ru/ (needs a browser).

If you can ssh to OSMC, please run the following commands:

grab-logs -J -K
cat /etc/resolv.conf
cat /etc/openvpn/config.ovpn

(I’m assuming the config.ovpn is in /etc/openvpn. Remove IP address of server.)

Logs successfully uploaded.
Logs available at http://paste.osmc.io/qituqinimu

search fritz.box
nameserver 192.168.XXX.XXX

osmc@osmc:~/OpenVPN$ cat OpenVPN_mod.ovpn
client
dev tun
proto tcp
float
nobind
cipher AES-128-CBC
comp-lzo adaptive
resolv-retry infinite
persist-key
persist-tun
remote XXX.XXX.XXX.XXX
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf

Thank you for helping

Jürgen

Please add an extra line to the openvpn config file OpenVPN_mod.ovpn

verb 3

then re-run openvpn and run

grab-logs -J
ifconfig
route
dpkg -l resolvconf

I also see that there is some kind of Kodi add-on for openvpn. Is it the Brian Hornsby add-on?

Edit: Added dpkg command.

Hello dillthedog

Here are the wanted informations:

Logs successfully uploaded.
Logs available at http://paste.osmc.io/jinenayebi

eth0 Link encap:Ethernet Hardware Adresse b8:27:eb:6a:f1:b4
inet Adresse:192.168.0.XXX Bcast:192.168.0.255 Maske:255.255.255.0
UP BROADCAST RUNNING MULTICAST DYNAMIC MTU:1500 Metrik:1
RX packets:555 errors:0 dropped:0 overruns:0 frame:0
TX packets:593 errors:0 dropped:0 overruns:0 carrier:0
Kollisionen:0 Sendewarteschlangenlänge:1000
RX bytes:203725 (198.9 KiB) TX bytes:110916 (108.3 KiB)

lo Link encap:Lokale Schleife
inet Adresse:127.0.0.1 Maske:255.0.0.0
inet6-Adresse: ::1/128 Gültigkeitsbereich:Maschine
UP LOOPBACK RUNNING MTU:65536 Metrik:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
Kollisionen:0 Sendewarteschlangenlänge:1
RX bytes:503 (503.0 B) TX bytes:503 (503.0 B)

tun0 Link encap:UNSPEC Hardware Adresse 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet Adresse:10.8.0.6 P-z-P:10.8.0.5 Maske:255.255.255.255
UP PUNKTZUPUNKT RUNNING NOARP MULTICAST MTU:1500 Metrik:1
RX packets:52 errors:0 dropped:0 overruns:0 frame:0
TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
Kollisionen:0 Sendewarteschlangenlänge:100
RX bytes:3614 (3.5 KiB) TX bytes:59527 (58.1 KiB)

Kernel-IP-Routentabelle
Ziel Router Genmask Flags Metric Ref Use Iface
default 10.8.0.5 128.0.0.0 UG 0 0 0 tun0
default fritz.box 0.0.0.0 UG 0 0 0 eth0
10.8.0.0 10.8.0.5 255.255.255.0 UG 0 0 0 tun0
10.8.0.5 * 255.255.255.255 UH 0 0 0 tun0
128.0.0.0 10.8.0.5 128.0.0.0 UG 0 0 0 tun0
customer-185-24 fritz.box 255.255.255.255 UGH 0 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
fritz.box * 255.255.255.255 UH 0 0 0 eth0

osmc@osmc:~$ dpkg -l resolvconf
Gewünscht=Unbekannt/Installieren/R=Entfernen/P=Vollständig Löschen/Halten
| Status=Nicht/Installiert/Config/U=Entpackt/halb konFiguriert/
Halb installiert/Trigger erWartet/Trigger anhängig
|/ Fehler?=(kein)/R=Neuinstallation notwendig (Status, Fehler: GROSS=schlecht)
||/ Name Version Architektur Beschreibung
++±==============-============-============-=================================
un resolvconf (keine Beschreibung vorhanden)

Yes. It is the add-on from Brian-Hornsby.

Thanks.

Jürgen

Hi. Thank you for the information.

Did you remember to add the verb 3 line to the config file? There is nothing appearing in the system log.

If you did add the line, do you know if Brian Hornsby’s add-on starts openvpn, or did you configure openvpn to start?

Edit: Looks like Brian Hornsby sends log data to a separate file.

Please therefore run paste-log /home/osmc/.kodi/userdata/addon_data/script.openvpn/openvpn.log

Hi dillthedog

You wrote:

I didn’t install the OpenVPN add-on out of the repositories. I downloaded Brian Hornsby’s and install from zip.

root@osmc:/home/osmc/.kodi/userdata/addon_data/script.openvpn# paste-log openvpn.log
http://paste.osmc.io/sedalijecu

Happy Easter and a nice Eastersunday

Jürgen

Hi. The openvpn log is very strange. It seems like it is not being run with verb 3, which would have given a lot more detail. I assume it is something to do with the way Brian Hornsby’s add-on works.

There are two main issues, as I see things:

  1. You are not successfully seeing Danish TV, and

  2. Openvpn seems to be having a few problems, but might be working well enough for your needs. As a result, I’ll not touch this part for now.

The reason why your connection to Danish TV is being rejected is unclear. The routing table seems to be ok, but the /etc/resolv.conf file shows that DNS is being resolved by the router, which will result in what is called a DNS leak, which means that DNS requests do not pass through the VPN tunnell. (BTW, there is no benefit from obscuring your private IP addresses; eg 192.168.x.x, and it can sometimes make debugging more difficult for us) It is possible that Danish TV is detecting the DNS leak.

Second, your openvpn configuration script contains two lines:

up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf

that will do nothing because the resolvconf package is not installed. However, for now do not install this package because I understand that it can cause problems.

In order to stop the DNS leak, for now I suggest that, instead of using DHCP and getting address details from the router, you configure OSMC using a static IP address and you also define your DNS servers on OSMC. Try these values

IP address 192.168.0.104
Netmask 255.255.255.0
Gateway 192.168.0.253

You’ll need to look on the router for the DNS IP addresses.

All these IP address can be set under My OSMC > Network. Setting up your network connection - General - OSMC

I hope you enjoy the rest of your holiday.

Hi dillthedog

I although noticed the thing about the DNS-leak, but was not sure, if this has an influence.
At the moment I cannot test your suggestions, because I am away from home. You’ll hear from me, when I get back.

Thanks for your efforts.

Jürgen

Install Vpn manager then you will have no issues.

I also am using openvpn with rpi3/kodi.
I have a simple script that launches on startup, but it connects to the the uk vpn (living in denmark)
When my wife wants to see the danish tv I have to go in manually and kill the vpn or start the danish vpn then it works.

MY question is, is there a way i could get the openvpn to change to a danish vpn or make a script that kills the uk vpn and start a danish on or simply kill the uk vpn then watch danish tv and when exiting the danish channel, revert to the uk vpn again ?

My script is a simple one, which loads openvpn on boot via local.rc.

Any ideas ?

Hi Peter, and welcome to the forum.

I think that getting the VPN to drop automatically when accessing Danish TV might be a bit difficult to achieve but there are two Kodi add-ons that will give you control of OpenVPN via the Kodi interface. You’ll need to disconect / connect manually but it’ll be a lot easier than having to SSH to the box, etc.

The first is Zomboided’s VPN Manager:

The second is Brian Hornsby’s OpenVPN add-on:

http://brianhornsby.com/kodi_addons/openvpn

Hi,

thanks for that, i will give that a try, i just seem to remember trying it and it did not work.
I will try again now.

so none of them work, im using PIA.
:-/

Hi,

From looking at both these plugins, I can’t see why either these won’t work pia. Zomboided’s wiki, reports support for PIA.

What doesn’t actually work?

Please report the steps you have taken to try and set these up?

Thanks Tom.