This can get the VPN into potentially more scenarios where edge cases can show up. In this case I would try and avoid pre-flight checks for determining the status of the network to setup the VPN tunnel. The device enters sleep mode, but the VPN tries to connect again and again (on demands takes effect) The VPN disconnects and then immediately reconnect (on demands takes effect), but it does so without waiting 20 seconds, which triggers the known bug for macOS Packet Tunnel Provider In all of those cases, the onDemand is enabled: Is there something that might explain this behavior, like "the PacketTunnelProvider wasn't killed properly", the PacketTunnelProvider crashed and the cause networking problems?Įdit: Is it possible, that some of the following cases are the cause for the "Network is unreachable" error?
So in order to solve it, how can I get more information? Can my app get the network information, and check the sockets state?Ĭan I get the system's logs and information and save it to my log file? The iOS app has no such problems even it uses the same code. Some users reported that when this happens, if they wait long enough ~10 min, they are able to connect again.
They aren't at an IPv6 only environment (and anyway, my apps support IPv6). This is not true because the users tried to ping multiple sites, and it went fine. From the app's logs, I can see the message "Network is unreachable". I've implemented a VPN app with Packet Tunnel Provider, both for iOS and macOS (both apps use the same extension code, with some minor differences).įor the macOS app, I'm getting reports from users that sometimes they can't connect using the client and has to disconnect and reconnect again their network (wireless or wired) in order to connect again.