[SOLVED] VPN to openHAB works from mobile but not from Windows 10

Hi All

I want to be able to connect to my openHAB remotely as if I was inside my local network so I can edit an update my .items files etc.

I’m able to do exactly what I want when connecting using my phones 4G signal through the openVPN app on iOS but not using my laptop. On Windows 10 I connect successfully using the openVPN GUI and when I Google my public ip I can see it has changed as it should but when I type in the local ip address of my openhab it does not connect. I cannot connect to my shares or using ssh either.

I’ve searched all over and have edited my laptops firewall and all sorts but without success.

It would be great if someone could point me in the right direction as I can see that many people on this forum connect successfully using this method.

This is going to be a an OpenVPN specific problem. Since a tiny minority of OH users use OpenVPN on Windows you will likely have more luck posting to an OpenVPN forum.

The OpenVPN server is running on my Pi which has openHAB on it too. I’m only using Windows as a way to connect to it. I just assumed someone else may have done the same here.

Sure I’ll head over to the OpenVPN forum then thanks. I’ll post the solution here when I find one.

Found a “solution”, hopefully this helps someone else.

To connect to my OH locally I use 192.168.0.222:8080

iPhone
When connecting remotely via my iPhone, using the openVPN App, I can then open a browser or the openHAB App and type in 192.168.0.222:8080 , I can also SSH using another App and see shares using another. So basically all works as if I was working locally.

Windows
Tried the same process via the openVPN GUI for Windows 10. Every time I tried 192.168.0.222:8080 I was shown a locally running OH instance and not my remote one.

Solution
When I connected my client on Windows I noticed a popup saying I was connected using 10.8.0.2 so I tried 10.8.0.2:8080 in the browser without success.

Anyway after a lot of experimenting I had an epiphany… 10.8.0.2 was the clients IP address and not the servers! Tried 10.8.0.1 and everything worked as it should.

Openhab in browser: 10.8.0.1:8080
Terminal: ssh pi@10.8.0.1
SMB: //10.8.0.1

2 Likes

You need to enable ip routing on the network protocol.

use this registry hack on the pc which runs openvpn. reboot is needed.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"IPEnableRouter"=dword:00000001

Thanks for the suggestion. I was previously able to reach my openhab server using 192.168.1.xxx:8080 ;when connected to the WireGuard VPN server running on the same Pi 4 B, which is running openhabian. However I recently did something that broke that. In trying to troubleshoot that, I stumbled across this thread, and the suggestion worked. I looked in my VPN set up (iPad, so Settings - VPN, then click on the information and see what the VPN IP address is (mine was 10.6.0.x). I entered 10.6.0.1:8080 and it worked. I still want to figure out how I messed it up. I believe it has something to do with the problem I was trying to fix with my nginx server. (It was failing and showing as degraded with systemctl status, so I tried reloading it with the openhabian set up.