-
Notifications
You must be signed in to change notification settings - Fork 213
KEEPALIVE_TIMEOUT log message from provider leaves the tunnel dead #141
Comments
Facing exactly same issue while using VPN ON Demand. Did you find any solution ? Also in my case- Don't know what to do ? |
I am monitoring my interface changes using I don't think it's the lack of documentation on how to do this with this library. I don't see anything in the Apple's documentation that details how to handle these interface changes. |
@javierdemartin Thanks for reply, |
You need to add your this observer in the
And observe the changes in the interfaces,
Here is a reference from StackOverflow talking about it. |
@javierdemartin Hi, Can you help me ? I tried to use this method but it doesn't transfer live continuous value to print on run time in viewController class. In viewController where networkmonitor - |
I am solving this at the moment by cancelling the tunnel if that log message is received from the provider. It's a workaround as I am checking if the func openVPNAdapter(_ openVPNAdapter: OpenVPNAdapter, handleLogMessage logMessage: String) {
if logMessage.contains("KEEPALIVE_TIMEOUT") {
cancelTunnelWithError(CancelTunnelErrors.keepAliveTimeout)
}
} I've seen that there is an error of the type |
Hi @javierdemartin, openvpn3 library responsible for throwing errors. I think it doesn't treat KEEPALIVE_TIMEOUT as error because you have As for switching interface, normally, these lines of code should force resetting of the tunnel and initialize reconnection using active interface: vpnReachability.startTracking { [weak self] status in
guard status != .notReachable else { return }
self?.vpnAdapter.reconnect(interval: 5)
} I'm going to update dependencies this weekend and will take a look at this issue as well. It would be very handy if you share your OpenVPN config with me so that I could find root of the problem. |
I've solved my issue by cancelling the tunnel when a My
|
I am tunnelling my traffic through a server. In some cases it has to block determinate websites, e.g. gambling sites. The tunnel works without a problem if I start the tunnel with WiFi or Cellular. When I change the network to the opposite the VPN reconnects automatically as I am using on demand VPN but the VPN doesn't block the websites it did before. My main supposition is that after changing the interface, WiFi to Cellular or vice versa, the outgoing traffic from the device it is not routed through the tunnel interface (
utun
) but the VPN is still up.How could I check or "force" the outgoing traffic through my tunnel interface?
I can detect when the interface changes and I could force restart the tunnel but I shouldn't do it. That should be the tunnel's task and I prefer not to force the tunnel's state.
This also happens after a while, between 2 to 5 minutes, the VPN restarts and in the network extension's provider
openVPNAdapter(_ openVPNAdapter: OpenVPNAdapter, handleLogMessage logMessage: String)
method I get the following messagesI don't know if this has to be related with my Swift code or with the OpenVPN server setup.
The text was updated successfully, but these errors were encountered: