-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No reconnect on network change #1299
Comments
yes your split horizon DNS breaks the assumption that the client does not need to reconnect if the server uses peer-id. As the server will automatically detect that this the same client but has changed its IP address. |
Thank you for taking the time to answer, @schwabe. Is there something I can do to force OpenVPN to re-resolve the server IP on network change? |
I have a similar problem. I ended up adding two servers in the config, one with public and one with local address, but it's clumsy. One aways fails and the other one picks up. This also doesn't allow me to point to a local address on my DNS when on LAN. It would be great to have an option on the client to resolve DNS on reconnect (or connectivity change), as opposed to using the cached value from the initial resolution. |
I settled on the exact same workaround as bar-tolini, but it's really more of a workaround than a solution. The local server is only used as a fallback once the first public IP fails, which takes 30 seconds. On top of that, the app takes a long time to realize that the first server IP is not responding and to issue a reconnect event via the ping-restart option. It can take up to 5 minutes for me sometimes. This means that coming home and connecting to the WiFi leads to 05:30 of no connectivity on the phone at all. |
I have the same issue, but I do not use a split-horizon DNS. My server address always resolve to the same IP address (my external one) The workaround doesn't work for me as the WAN address still works from with-in my LAN. Why can't the app detect the network change?? |
@SingingFrog7 please provide a log. The app normally detects network changes |
@schwabe Thanks for your time. Disabling the option is a workaround for now, but that means all my LAN traffic is going through the VPN (even when home) instead and I guess I won't be able to access the LAN when connected somewhere else. As the probleme is different, I'll open a different issue |
Same issue here : I'm using OpenVPN on a work profile, and Blokada on the other profile. @schwabe : as an Android developer, I had the same issue using |
I am not actually using that API buther rather
|
Samsung Note 20 Ultra, Android 13 It could be that the peer-id mechanism is preventing a tunnel restart because the changed ip address can be easily accommodated by the server. Yet applications like VOIP is effected by the IP change locally because they bypass the vpn for local traffic. An IPCHANGE scripit may be needed to force a tunnel restart with the new ip! Any workarounds? |
To make issues more manageable, I would appreciate it if you fill out the following details as applicable:
General information
Description of the issue
OpenVPN for Android -> Settings -> Reconnect on network change is set to True.
When I de-activate my phone's WiFi and switch to LTE connection, there is no automatic reconnection happening. I have to manually click "reconnect". This also happens when moving from LTE to WiFi.
I am hosting my own OpenVPN server in my LAN. Thus, I have a split-horizon DNS setup where
vpn.mydomain.com
resolves to my external IP when connecting from WAN, and to my server's LAN IP when connected to the LAN. I am only mentioning this because I am unsure if this could be a cause of the issue.Example log:
and from here on, nothing happens - my connection is not re-established, so I have no access to the Internet until I manually reconnect.
The text was updated successfully, but these errors were encountered: