Hello, I am working on a NEPacketTunnelProvider and I am not exactly sure if I correctly understand the NEPacketTunnelNetworkSettings.
For example the ipv4Settings according to docs:
Currently I have this:
Which seems to work pretty well, both for WiFi and cellular. In the past I tried various other addresses, even manually including all the IPV4 routes but I never noticed any effect regarding the tunnel.
Then there is the includedRoutes property.
This seems to work best when I don't set anything. I tried setting all the routes but that did not change things a bit. The only difference is when I set includedRoutes to NEIPv4Route.default(). Then some apps stop working when the tunnel is active.
This is strange, because even setting all the available routes + default one doesn't fix this "issue".
What is the relation between these properties? It is best to not set includedRoutes if the tunnel works fine?
And lastly. What about dnsSettings? This looks like another optional property. Does it make sense to manually specify DNS to point maybe to 1.1.1.1?
For example the ipv4Settings according to docs:
So this seems like unless I set all the possible routes here, the tunnel should not work for all the traffic?This property contains the IPv4 routes specifying what IPv4 traffic to route to the tunnel, as well as the IPv4 address and netmask to assign to the TUN interface.
Currently I have this:
Code Block swift let ipv4Settings: NEIPv4Settings = NEIPv4Settings( addresses: ["192.169.89.1"], subnetMasks: ["255.255.255.255"] )
Which seems to work pretty well, both for WiFi and cellular. In the past I tried various other addresses, even manually including all the IPV4 routes but I never noticed any effect regarding the tunnel.
Then there is the includedRoutes property.
So this is basically another way to set the address like in the constructor for NEIPv4Settings?The routes that specify what IPv4 network traffic will be routed to the TUN interface.
This seems to work best when I don't set anything. I tried setting all the routes but that did not change things a bit. The only difference is when I set includedRoutes to NEIPv4Route.default(). Then some apps stop working when the tunnel is active.
This is strange, because even setting all the available routes + default one doesn't fix this "issue".
What is the relation between these properties? It is best to not set includedRoutes if the tunnel works fine?
And lastly. What about dnsSettings? This looks like another optional property. Does it make sense to manually specify DNS to point maybe to 1.1.1.1?