zaneschepke / wgtunnel

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

[BUG] - VPN loses connectivity #107

Open Idowza opened 4 months ago

Idowza commented 4 months ago

Describe the bug VPN loses connectivity periodically

Smartphone (please complete the following information):

To Reproduce Steps to reproduce the behavior:

VPN will lose connectivity every now and then. I'm not sure what triggers the loss in connectivity. Stopping and stating the VPN will immediately restore connectivity.

Expected behavior A clear and concise description of what you expected to happen.

The VPN used to always keep connectivity. All other devices stay connected. (iOS, desktop)

Screenshots (Only if necessary)

Additional context Add any other context about the problem here.

Idowza commented 4 months ago

I tested the official wireguard app, and it has the same issue.

It still only seems to affect Android devices.

zaneschepke commented 4 months ago

I tested the official wireguard app, and it has the same issue.

It still only seems to affect Android devices.

Thank you for this additional information. I am guessing this is the same DNS issue as has been commonly reported with both WireGuard's official app and this app (both apps use the same wireguard official core library). I'm currently brainstorming a few ways around this issue.

Idowza commented 4 months ago

It does seem to be quite a common issue. When I first started using wireguard (and your app) it was flawless. I unfortunately cannot think of what changed.

I did add "25" to the persistent keep alive which seems to fix the issue. However it does say it's "not recommended.". Does using persistent keepalive leak your IP somehow?

zaneschepke commented 4 months ago

It do not think it leaks IP. It seems it just goes against WireGuard's silent protocol methodology. It is necessary for peers behind NAT and firewalls though. For more information, read here.

metronidazole commented 4 months ago

Thank you for this additional information. I am guessing this is the same DNS issue as has been commonly reported with both WireGuard's official app and this app (both apps use the same wireguard official core library)

Do you have a link for this reported issue elsewhere?

I couldn't find any other documentation regarding the issue which I starting having in the past few weeks myself (official app)?

zaneschepke commented 3 months ago

There is a somewhat lengthy but useful dialog here about connectivity issues around DNS. To help mitigate connectivity issues, I've added a ping feature to auto tunneling that will attempt to restart the tunnel if pinging the server fails. It is a pretty rudimentary implementation/solution for now, but I hope to make it more robust in the future. I'll mark this one as closed for now with the release of 3.3.9 that has this ping feature.

metronidazole commented 3 months ago

There is a somewhat lengthy but useful dialog here about connectivity issues around DNS. To help mitigate connectivity issues, I've added a ping feature to auto tunneling that will attempt to restart the tunnel if pinging the server fails. It is a pretty rudimentary implementation/solution for now, but I hope to make it more robust in the future. I'll mark this one as closed for now with the release of 3.3.9 that has this ping feature.

Does that need auto-tunneling turned on to work? In my use case, I want the tunnel always active and its unclear if autotunelling would allow that (and I'd like that autorestart feature)

zaneschepke commented 3 months ago

There is a somewhat lengthy but useful dialog here about connectivity issues around DNS. To help mitigate connectivity issues, I've added a ping feature to auto tunneling that will attempt to restart the tunnel if pinging the server fails. It is a pretty rudimentary implementation/solution for now, but I hope to make it more robust in the future. I'll mark this one as closed for now with the release of 3.3.9 that has this ping feature.

Does that need auto-tunneling turned on to work? In my use case, I want the tunnel always active and its unclear if autotunelling would allow that (and I'd like that autorestart feature)

Ah! I did not realize the auto-tunneling restrictions would not allow this feature to be used with AOVPN. Right now, it is purely an auto-tunneling feature, but it would be a very small change to make this work with AOVPN as well. I'll reopen this issue to get this added.

TheDarkula commented 2 months ago

@zaneschepke Thank you so much for your work! Having this implemented for always-on would be amazing :)