zaneschepke/wgtunnel

[BUG] - Auto-tunneling on WiFi name not working

Closed this issue ยท 20 comments

Describe the bug
I've created a new WG tunnel, with the settings I've given the WiFi name I wish to use the tunnel on.
Set as primary tunnel YES
Set as mobile data tunnel NO
WifiName is there with the cross on it. No regex
Restart on ping fail (beta) NO

Smartphone (please complete the following information):

  • Device: OnePlus 9
  • Android Version: Android 14
  • App Version: 3.5.2
  • Backend: Usespace

To Reproduce
Steps to reproduce the behavior:

  1. Create WG tunnel
  2. Mark as pirmary tunnel
  3. Add Wifi name to the list
  4. Enable auto tunneling in the main app settings.
  5. Notification for auto tunnel appears

Expected behavior
Auto connect to tunnel when that wifi is connected. Then disconnect once it leaves the WiFi

Hello! This sounds like an issue with permissions. If you check the logs screen, do you see something that says found valid SSID?

It seems like you either do not have precise location + always allow location permission or you have location services disabled?

Thanks for getting back to me.

Checked the app's permissions and showing as all the time and precise is enabled for location.

I tried exporting the logs, but its only exporting one log at a time. When I try scrolling up, it then throws me to the bottom with a new event saying that I finger swiped on the app ๐Ÿ˜…

Do you have location services turned on?

You should be able to click the save floating action button and it will save a zip of logs to your downloads folder.

Yeah, I need to fix that scroll issue.๐Ÿ˜… I'll add a fix for that.

Location Services are definitely on and confirmed by using GPS in Maps app.

If go Support -> Read the logs -> Press the floating save icon, it doesn't do anything until I press a log, then when I press the save icon, it then saves that log to a txt file in Download. So is that also broken or did I do something wrong ๐Ÿ˜…

I'll look into this issues with the logs export. Does the wifi name have any special characters? There is currently an issue open right now where some regex characters are causing issues.

I'll look into this issues with the logs export. Does the wifi name have any special characters? There is currently an issue open right now where some regex characters are causing issues.

WiFi name was all letters and no spaces.

If you get a chance to upgrade to the new version, the logs experience should be improved for the scrolling. It would then be helpful to get the logs or log message you see when your SSID changes.

If you get a chance to upgrade to the new version, the logs experience should be improved for the scrolling. It would then be helpful to get the logs or log message you see when your SSID changes.

Did that version get published to the beta testers on the PlayStore? Don't want to use the APK, as I believe it stops it auto updating ๐Ÿ˜…

No worries! It is in review right now for Google Play. It should be published soon!

New version should now be out on Google Play.

Just tested it, searched the logs for the SSID name when I changed wifi, and it doesn't appear in any of the log files I exported.

Is there any other key words to look for?

The SSID name will not appear in the logs, but you will see a message saying valid SSID or invalid SSID. This will help us determine if there is a permission issue.

Just toggled my wifi off and on to test, and there's no SSID in the logs I exported. Tried it twice now as well.

That's with
Tunnel on untrusted wifi FALSE
Tunnel on mobile data FALSE
Tunnel on ethernet FALSE
Restart on Ping Fail FALSE
Start Auto-tunneling pressed to started it now reads Stop auto-tunneling, notification appeared

Then in the primary WG tunnel, I have the WiFi SSID listed.

Auto wifi tunneling also broke for me with the release of 3.5.3. the new dumpsys network detection says the SSID is "-"

Just tested 3.6.0 still no luck. I opened the log in the app, and toggled WiFi off and on, and also switched WiFi networks via the WiFi applet in the notification area. Seeing no events to say the app even saw the WiFi change network. That's with just Auto Tunnelling Enabled.

Enabling Tunnel on untrusted WiFi, the profiles do get picked correctly and also if I put a trusted WiFi name in, it also disconnects the VPN while on that network. I can see the events happening in the logs.

So I can get the original auto WiFi feature working to auto connect on all untrusted WiFi, but I can't get it to only connect on certain WiFi names. Which you implemented back in September. As if it doesn't listen for those WiFi events unless the old setting is ticketed.

Or have I been doing this wrong and I need to use wildcards to whitelist all SSIDs, then do a invert wildcard on the WiFi networks that I don't trust?

Having the same issue here. Galaxy S22 fwiw. Location services and permissions are enabled.

The auto tunneling works if using the global "on mobile data" or "untrusted wifi" options, but the specific wifi name on an individual tunnel does not work.

Edit: it appears that this only work when "tunnel on untrusted wifi" is enabled, and by not adding any wifi names to the list. It's a little inconvenient, but the workaround i found to work is by adding the wildcard to capture all * (turn on wildcards) in the list of trusted, and then exclude using ! the wifi names you wish to use specific tunnels on, and then adding those names to the individual tunnels.

Edit2: everything i mentioned above suddenly stopped working. Not basically no auto tunneling works. It's very finicky. It'll work for a while then have issues.

Not working anymore running latest 3.6.1-fecc55f-nightly.
Don't know the previous nightly release versions but it worked 2-3 updates ago.

The problem must be in wildcards reading. It always work when the wildcard is "*" but then all WiFi SSID are untrusted and auto tunneling doesn't work on any SSID.

Doesn't work when the trusted WiFi wildcard is full SSID eg. "My_Wifi" or "My_Wif*" or "My_Wif?". Only the "*" wildcard is accepted. It's something I've observed since the stable 3.5.2 version, then 3.5.3, then on a couple of 3.6.x nightly releases as I've switched to nightlies.

Can someone help me understand the exact use case? It sounds like basically we want to be able to tunnel on a single specific SSID for a specific tunnel while all other SSIDs are "trusted" and we are trying to accomplish this with wildcards. Do I have that right?

To accomplish this you would enable tunnel on untrusted wifi, enabled wildcards, add * as trusted, add !your-wifi-name as trusted (making it excluded from trusted) and then adding that wifi name to the specific tunnel settings for whichever tunnel you would like to use on that wifi. I tested this and it seems to work for me. Important Note If your wifi name includes special regex characters, these will need to be escaped when you are using the wildcards feature. See the docs for which characters these are and how to escape them.

Yes that's exactly, what I'm wanting to do. I shall do that with the regex then ๐Ÿ‘๐Ÿป

I think this one should be resolved in the lasts version 3.6.3. Let me know if there are still issues and I'll reopen the ticket. Thanks!