zaneschepke / wgtunnel

An alternative Android client app for WireGuard VPN
https://zaneschepke.com/wgtunnel-docs
MIT License
788 stars 43 forks source link

[BUG] - Auto tunnel - fails to disconnect VPN when moving from non trusted WiFi to mobile data #209

Closed thewookiewon closed 1 month ago

thewookiewon commented 4 months ago

Describe the bug Auto tunnel is on VPN on mobile data is off

When I moved from a non trusted WiFi to mobile data the VPN stayed connected even when I've disabled the setting for VPN on mobile data.

Smartphone (please complete the following information):

To Reproduce Steps to reproduce the behavior:

  1. Have tunnel on mobile data set to off, then connect to non trusted WiFi. Wait for VPN to connect then roam away from the non trusted WiFi.

Manually turning WiFi off in settings works as expected so this seems to be an issue when connected and moving away from the non trusted WiFi AP.

Expected behavior VPN to disconnect when on mobile data if the applicable settings isn't applied.

Screenshots (Only if necessary)

Additional context Add any other context about the problem here.

zaneschepke commented 4 months ago

Thanks for letting me know! As you can imagine, I usually test the app with the latter method of the disabling wifi. I'll see if I can reproduce this issue of moving out of the range of the AP.

zaneschepke commented 4 months ago

So I've done some testing on this and it seems you need to have lost connection from the wifi network for 5 to 10 seconds for Android to validate that the connection has been lost and trigger the onLost network callback. Can you verify this is the case with your device or does it never trigger?

thewookiewon commented 4 months ago

So the journey from my supermarket to my house is only 5mins by car. My phone never joined my car's android auto by WiFi for that journey.

I parked up before getting home and Android auto complained about the active VPN.

zaneschepke commented 4 months ago

So the journey from my supermarket to my house is only 5mins by car. My phone never joined my car's android auto by WiFi for that journey.

I parked up before getting home and Android auto complained about the active VPN.

I see. I'll try a different device and see if I can replicate this behavior, but so far I am unable to. Also, encase you are not aware, you can configure split tunneling so Android Auto works while you are connected to VPN.

thewookiewon commented 4 months ago

I'm aware, just haven't looked into split tunnel yet 🤔

I didn't grab logs before it's rolled over either so I'll see if it occurs again

zaneschepke commented 4 months ago

So I've improved the logging in the latest 3.4.5 where a history will now be written to local storage (more than what is shown in the live view) so sharing logs will almost always have the relevant information in the log history file. I also fixed some bugs around mobile data auto tunneling. Please let me know if the new version is solving this issue. Thanks!