Search results for

“includeAllNetworks”

157 results found

Post

Replies

Boosts

Views

Activity

Reply to PacketTunnelProvider Simple tunnel not work
@matt, thanks for the support :) The configuration for packet tunnel is that: protocolConfiguration type = plugin identifier = 7FCF645B-4707-42AE-BFB9-76903115D4F5 serverAddress = x.x.x.x:PORT // This is IP:PORT FORMAT identityDataImported = NO disconnectOnSleep = NO disconnectOnIdle = NO disconnectOnIdleTimeout = 0 disconnectOnWake = NO disconnectOnWakeTimeout = 0 includeAllNetworks = NO excludeLocalNetworks = YES enforceRoutes = NO pluginType = bundleIdentifier of the app that contains the extension authenticationMethod = 0 reassertTimeout = 0 And the code of the start tunnel override func startTunnel(options: [String : NSObject]?, completionHandler: @escaping (Error?) -> Void) { let newTunnel = ClientTunnel() newTunnel.delegate = self if let error = newTunnel.startTunnel(self) { completionHandler(error as NSError) } else { // Save the completion handler for when the tunnel is fully established. pendingStartCompletion = completionHandler tunnel = newTunnel } } And the VPNStatus is .connected My
Topic: App & System Services SubTopic: General Tags:
Aug ’21
Reply to Is there a way to exclude traffic generated by VPN Controller App from packet-tunnel provider running in ip-destination mode?
I suspect you want to gather some information to provide to your VPN in aide in tunnel connection, and that is why you want to make a network call before the tunnel is connected. You understood it correctly. Let me explain it again in more detail. As part of establishing VPN connection, Just after successful SSL Handshake with Tunnel Server, Tunnel Server provides one URL, Packet Tunnel extension passes this URL to VPN Controller App, and using this URL Controller App fetches some settings(user auth required). Since Network connectivity is blocked until the VPN is connected, we are unable to make a call to URL provided by Tunnel Server, and we have to make this call to fetch some settings which is required in order to establish VPN connection(before we return completionHandler(nil)). are you able fetch those resources inside the provider? As I mentioned above, unfortunately No. ` Since Network connectivity is blocked until the VPN is connected, unable to fetch required resources inside the provider. so presum
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’23
The ‘NEVPNProtocol.includeAllNetworks’ is not working on iOS 16+
https://developer.apple.com/documentation/networkextension/nevpnprotocol/3131931-includeallnetworks The ‘includeAllNetworks’ property was introduced in iOS 14 to allow VPN configuration on iOS to force all network traffic through the VPN tunnel, to prevent any leaks outside the tunnel. Older version of this document said:
 A Boolean value that indicates whether the system sends all network traffic over the tunnel. Current documentation says: A Boolean value that indicates whether the system sends most network traffic over the tunnel. There are a few issues with this change: The change in functionality was introduced without any notice or change in developer documentation. The documentation was updated almost a year after the change in functionality. The property should have been deprecated in iOS 16, and the new property should have been introduced. I would suggest a more accurate name - ‘includeMostNetworks’ instead of ‘includeAllNetworks’. After reading the updated documentation,
1
0
678
Aug ’23
Reply to VPN profile corruption
I've since gone and uploaded yet another sysdiagnose where we seemingly see the same thing happens, this time, on every reinstall from Xcode. In this case, once the newly installed packet tunnel starts, all networking on the device is broken, and seemingly this reliably reproduces. However, it doesn't happen by default, usually after a day of not restarting the device and developing does this start happening again. I've barely had time to look at the sysdiagnose, but from the cursory look there's plenty of No route to host errors, which would explain why the packet tunnel is not able to connect. Why is there no route to host? Who knows. At the time of installation, the VPN profile of the app I'm developing is set to be used on-demand, and it is set to include all routes (0.0.0.0/0 and ::0/0). We are not using enforceRoutes or includeAllNetworks due to bugs. It seems that there is a discrepancy between the two packet tunnel instances (the old one and new one), and one of them is desperately trying to
Jan ’26
ExcludeLocalNetworks
Hello, Regarding this explanation If this property is YES, the system excludes network connections to hosts on the local network — such as AirPlay, AirDrop, and CarPlay — but only when the includeAllNetworks or enforceRoutes property is also YES. So my question is the local network here only meaning AirPlay, AirDrop, and CarPlay? Is the pings to local LAN IP still working? What is the exactly the local network definition here? Is it based on the interface or the IPs? For example, somehow we connects to a wifi which assigned a public IP. After VPN is connected with tunnel all mode, we set includeAllNetworks and excludeLocalNetworks flag, will the traffic originally goes through wlan interface goes through utun interface? Or it will keep going through wlan interface?
0
0
500
Sep ’23
Reply to Split tunnel w/o changing route table
[quote='841929022, RBmint, /thread/786651?answerId=841929022#841929022, /profile/RBmint'] supposedly can filter packets and redirect them into different TUN interface without changing the route table. [/quote] Apple platform do have something like this — like I said, two of everything! (-: — namely NECP. For some very limited details on that, see A Peek Behind the NECP Curtain. However, as a third-party developer you have a very limited view into NECP, and it certainly won’t help with this. The go-to doc on this is Routing your VPN network traffic. It explains: How includeAllNetworks represents a giant switch, which effectively disables destination IP routing. This setting is implemented using NECP. How enforceRoutes lets you continue using destination IP routing but prevents apps from bypassing that. [quote='841929022, RBmint, /thread/786651?answerId=841929022#841929022, /profile/RBmint'] I'm also a little bit curious about other VPN's split tunneling function. Do they not exist/not work on macOS at
Jun ’25
`NEVPNProtocol.includeAllNetworks` and `NEPacketTunnelProvider.createTCPConnectionThroughTunnel`
The .includeAllNetworks flag on the NEVPNProtocol object seems suitable for use as a vpn kill switch. At the very least, the documentation specifies that if this value is true and the tunnel is unavailable, the system drops all network traffic. Our application has a UI element that allows the user to toggle this setting, for the purposes of ensuring that all of their traffic is sent through the VPN connection. We're encountering an issue, however: it appears that, with this setting enabled, any NWTCPConnection returned by NEPacketTunnelProvider.createTCPConnectionThroughTunnel will never connect. It stays in the .connecting state and never advances to the .connected state. The documentation for this method states that this method can be used to create a TCP connection to an endpoint inside the private network. Does this mean that the remote endpoint being connected to by createTCPConnectionThroughTunnel must reside inside the private network being connected to by the tunnel in order for it to work pr
8
0
2.0k
May ’22
Reply to Network system extension failing to load
Hi Matt,I able to fix the IPC issues. Now i could see it is saving the configuation correctly. But next my expectation was to get the callback on App proxy provider(i.e. AppProxyProvider) but not getting the callback. Looks like it is not able to get into the network system extension. Network preference, extension status showing as Connecting...) Any thought please? ( {n localizedDescription = MyExtension n enabled = YESn protocolConfiguration = {n serverAddress = <23-char-str>n disconnectOnSleep = NOn includeAllNetworks = NOn excludeLocalNetworks = NOn providerBundleIdentifier = com.sample.extensionn }n onDemandEnabled = NOn} )Extension info.plist:<?xml version=1.0 encoding=UTF-8?> <!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd> <plist version=1.0> <dict> <key>CFBundleDevelopmentRegion</key> <string>$(DEVELOPMENT_LANGUAGE)</string> <key>CFBundleDisplayName</key> <string>FPNetwor
Jun ’20
Some questions on NEPacketTunnelProvider on iOS 15
Recently I tested my VPN application on iOS 15 beta 8 / Xcode 13 beta 5. It looks like that the precedence is IPSec VPN > iCloud private relay > NEPacketTunnelProvider VPN. When the iCloud private relay is switched on if use IPSec VPN(I think it's using the IPSec interface) the browser's network traffic is still being routed to the IPSec tunnel. But for the implementation with NEPacetTunnelProvider VPN(UTUN interface) the browser's traffic is being routed to the private relay. I don't see any doc describing this but it seems this is the design. And another question is the IncludeAllNetworks setting for the VPN. If set the IncludeAllNetworks to be 1 then the device global traffic would be routed to the VPN, but the excludedRoutes settings in the VPN would be unavailable, no routes would be excluded. Is the above understanding correct?
2
0
926
Sep ’21
Binding socket to an interface in Network Extension
When trying to bind a socket to the tunnel interface via setsockopt(socket, IPPROTO_IP, IP_BOUND_IF, &ifindex, len) Within the PacketTunnel itself despite this call succeeding the data is still routed through the default interface. This is observed when includeAllNetworks is true. When it is false it seems to send it on both interfaces. Is there something wrong with how I'm doing it?
4
0
1.3k
Sep ’22
NEPacketTunnelProvider can't get device's packets
Hi, I'm new in this area. I have several questions to ask. I'm implementing a vpn client by using NETunnelProviderProtocol(). After I start the tunnel successfully, I can't get any packets from self.packetFlow.readPacketObjects. Is the NETunnelProviderProtocol able to gather the packet from whole device ?(just work like a normal vpn client) Is it safe to turn includeAllNetworks() to true? thanks
15
0
1.1k
May ’21
enforceRoutes causes excludedRoutes to be ignored
In our PacketTunnelProvider we are seeing behavior for enforceRoutes which appears to contradict the documentation. According to the developer documentation (my emphasis): If this property is YES when the includeAllNetworks property is NO, the system scopes the included routes to the VPN and the excluded routes to the current primary network interface. If we set these IPv4 settings: IPv4Settings = { configMethod = manual addresses = ( 172.16.1.1, ) subnetMasks = ( 255.255.255.255, ) includedRoutes = ( { destinationAddress = 0.0.0.0 destinationSubnetMask = 0.0.0.0 }, ) excludedRoutes = ( { destinationAddress = 10.10.0.0 destinationSubnetMask = 255.255.255.0 }, ) overridePrimary = YES } Then if enforceRoutes is set to YES, then we do not see traffic for the excluded network, which is the expected behavior. If enforceRoutes is set to NO, then we do see traffic for the excluded network. In both cases includeAllNetworks and excludeLocalNetworks are both NO. The excluded network is not one of the
6
0
1.6k
May ’23
split Tunnel + exclude APNs
Hello, im currently developing proxy app with XrayCore trying to bypass APNs when tunnel us up and i found .excludeAPNs property in NETunnelProviderProtocol that works only when includeAllNetworks property is also TRUE. I wonder if there is a possible way to make APNs bypass tunnel in split tunnelling mode? because we use excludedRoutes and full tunnel is not an option
1
0
143
May ’25
Configuring Routing network traffic properties
Requirement: We need to update below tunnel provider properties once VPN is up. Is it possible? includeAllNetworks excludeLocalNetworks enforceRoutes When is the standard time to configure and save the below properties in system preferences? Is it possible to save these properties in system preference when VPN is up? saveToPreferencesWithCompletionHandler If we can change these properties in VPN connected state, When these tunnel provider properties will come into effect?
1
0
574
Mar ’24
Reply to PacketTunnelProvider Simple tunnel not work
@matt, thanks for the support :) The configuration for packet tunnel is that: protocolConfiguration type = plugin identifier = 7FCF645B-4707-42AE-BFB9-76903115D4F5 serverAddress = x.x.x.x:PORT // This is IP:PORT FORMAT identityDataImported = NO disconnectOnSleep = NO disconnectOnIdle = NO disconnectOnIdleTimeout = 0 disconnectOnWake = NO disconnectOnWakeTimeout = 0 includeAllNetworks = NO excludeLocalNetworks = YES enforceRoutes = NO pluginType = bundleIdentifier of the app that contains the extension authenticationMethod = 0 reassertTimeout = 0 And the code of the start tunnel override func startTunnel(options: [String : NSObject]?, completionHandler: @escaping (Error?) -> Void) { let newTunnel = ClientTunnel() newTunnel.delegate = self if let error = newTunnel.startTunnel(self) { completionHandler(error as NSError) } else { // Save the completion handler for when the tunnel is fully established. pendingStartCompletion = completionHandler tunnel = newTunnel } } And the VPNStatus is .connected My
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Is there a way to exclude traffic generated by VPN Controller App from packet-tunnel provider running in ip-destination mode?
I suspect you want to gather some information to provide to your VPN in aide in tunnel connection, and that is why you want to make a network call before the tunnel is connected. You understood it correctly. Let me explain it again in more detail. As part of establishing VPN connection, Just after successful SSL Handshake with Tunnel Server, Tunnel Server provides one URL, Packet Tunnel extension passes this URL to VPN Controller App, and using this URL Controller App fetches some settings(user auth required). Since Network connectivity is blocked until the VPN is connected, we are unable to make a call to URL provided by Tunnel Server, and we have to make this call to fetch some settings which is required in order to establish VPN connection(before we return completionHandler(nil)). are you able fetch those resources inside the provider? As I mentioned above, unfortunately No. ` Since Network connectivity is blocked until the VPN is connected, unable to fetch required resources inside the provider. so presum
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jan ’23
The ‘NEVPNProtocol.includeAllNetworks’ is not working on iOS 16+
https://developer.apple.com/documentation/networkextension/nevpnprotocol/3131931-includeallnetworks The ‘includeAllNetworks’ property was introduced in iOS 14 to allow VPN configuration on iOS to force all network traffic through the VPN tunnel, to prevent any leaks outside the tunnel. Older version of this document said:
 A Boolean value that indicates whether the system sends all network traffic over the tunnel. Current documentation says: A Boolean value that indicates whether the system sends most network traffic over the tunnel. There are a few issues with this change: The change in functionality was introduced without any notice or change in developer documentation. The documentation was updated almost a year after the change in functionality. The property should have been deprecated in iOS 16, and the new property should have been introduced. I would suggest a more accurate name - ‘includeMostNetworks’ instead of ‘includeAllNetworks’. After reading the updated documentation,
Replies
1
Boosts
0
Views
678
Activity
Aug ’23
VPN causes CarPlay to not work
Configuring a VPN with includeAllNetworks causes CarPlay / Netflix Cast. Even enabling excludeLocalNetworks does not resolve this issue. Is this a known issue and can we work around this?
Replies
4
Boosts
0
Views
1.4k
Activity
Aug ’22
Reply to VPN profile corruption
I've since gone and uploaded yet another sysdiagnose where we seemingly see the same thing happens, this time, on every reinstall from Xcode. In this case, once the newly installed packet tunnel starts, all networking on the device is broken, and seemingly this reliably reproduces. However, it doesn't happen by default, usually after a day of not restarting the device and developing does this start happening again. I've barely had time to look at the sysdiagnose, but from the cursory look there's plenty of No route to host errors, which would explain why the packet tunnel is not able to connect. Why is there no route to host? Who knows. At the time of installation, the VPN profile of the app I'm developing is set to be used on-demand, and it is set to include all routes (0.0.0.0/0 and ::0/0). We are not using enforceRoutes or includeAllNetworks due to bugs. It seems that there is a discrepancy between the two packet tunnel instances (the old one and new one), and one of them is desperately trying to
Replies
Boosts
Views
Activity
Jan ’26
ExcludeLocalNetworks
Hello, Regarding this explanation If this property is YES, the system excludes network connections to hosts on the local network — such as AirPlay, AirDrop, and CarPlay — but only when the includeAllNetworks or enforceRoutes property is also YES. So my question is the local network here only meaning AirPlay, AirDrop, and CarPlay? Is the pings to local LAN IP still working? What is the exactly the local network definition here? Is it based on the interface or the IPs? For example, somehow we connects to a wifi which assigned a public IP. After VPN is connected with tunnel all mode, we set includeAllNetworks and excludeLocalNetworks flag, will the traffic originally goes through wlan interface goes through utun interface? Or it will keep going through wlan interface?
Replies
0
Boosts
0
Views
500
Activity
Sep ’23
Reply to Split tunnel w/o changing route table
[quote='841929022, RBmint, /thread/786651?answerId=841929022#841929022, /profile/RBmint'] supposedly can filter packets and redirect them into different TUN interface without changing the route table. [/quote] Apple platform do have something like this — like I said, two of everything! (-: — namely NECP. For some very limited details on that, see A Peek Behind the NECP Curtain. However, as a third-party developer you have a very limited view into NECP, and it certainly won’t help with this. The go-to doc on this is Routing your VPN network traffic. It explains: How includeAllNetworks represents a giant switch, which effectively disables destination IP routing. This setting is implemented using NECP. How enforceRoutes lets you continue using destination IP routing but prevents apps from bypassing that. [quote='841929022, RBmint, /thread/786651?answerId=841929022#841929022, /profile/RBmint'] I'm also a little bit curious about other VPN's split tunneling function. Do they not exist/not work on macOS at
Replies
Boosts
Views
Activity
Jun ’25
`NEVPNProtocol.includeAllNetworks` and `NEPacketTunnelProvider.createTCPConnectionThroughTunnel`
The .includeAllNetworks flag on the NEVPNProtocol object seems suitable for use as a vpn kill switch. At the very least, the documentation specifies that if this value is true and the tunnel is unavailable, the system drops all network traffic. Our application has a UI element that allows the user to toggle this setting, for the purposes of ensuring that all of their traffic is sent through the VPN connection. We're encountering an issue, however: it appears that, with this setting enabled, any NWTCPConnection returned by NEPacketTunnelProvider.createTCPConnectionThroughTunnel will never connect. It stays in the .connecting state and never advances to the .connected state. The documentation for this method states that this method can be used to create a TCP connection to an endpoint inside the private network. Does this mean that the remote endpoint being connected to by createTCPConnectionThroughTunnel must reside inside the private network being connected to by the tunnel in order for it to work pr
Replies
8
Boosts
0
Views
2.0k
Activity
May ’22
Reply to Network system extension failing to load
Hi Matt,I able to fix the IPC issues. Now i could see it is saving the configuation correctly. But next my expectation was to get the callback on App proxy provider(i.e. AppProxyProvider) but not getting the callback. Looks like it is not able to get into the network system extension. Network preference, extension status showing as Connecting...) Any thought please? ( {n localizedDescription = MyExtension n enabled = YESn protocolConfiguration = {n serverAddress = <23-char-str>n disconnectOnSleep = NOn includeAllNetworks = NOn excludeLocalNetworks = NOn providerBundleIdentifier = com.sample.extensionn }n onDemandEnabled = NOn} )Extension info.plist:<?xml version=1.0 encoding=UTF-8?> <!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd> <plist version=1.0> <dict> <key>CFBundleDevelopmentRegion</key> <string>$(DEVELOPMENT_LANGUAGE)</string> <key>CFBundleDisplayName</key> <string>FPNetwor
Replies
Boosts
Views
Activity
Jun ’20
Some questions on NEPacketTunnelProvider on iOS 15
Recently I tested my VPN application on iOS 15 beta 8 / Xcode 13 beta 5. It looks like that the precedence is IPSec VPN > iCloud private relay > NEPacketTunnelProvider VPN. When the iCloud private relay is switched on if use IPSec VPN(I think it's using the IPSec interface) the browser's network traffic is still being routed to the IPSec tunnel. But for the implementation with NEPacetTunnelProvider VPN(UTUN interface) the browser's traffic is being routed to the private relay. I don't see any doc describing this but it seems this is the design. And another question is the IncludeAllNetworks setting for the VPN. If set the IncludeAllNetworks to be 1 then the device global traffic would be routed to the VPN, but the excludedRoutes settings in the VPN would be unavailable, no routes would be excluded. Is the above understanding correct?
Replies
2
Boosts
0
Views
926
Activity
Sep ’21
Binding socket to an interface in Network Extension
When trying to bind a socket to the tunnel interface via setsockopt(socket, IPPROTO_IP, IP_BOUND_IF, &ifindex, len) Within the PacketTunnel itself despite this call succeeding the data is still routed through the default interface. This is observed when includeAllNetworks is true. When it is false it seems to send it on both interfaces. Is there something wrong with how I'm doing it?
Replies
4
Boosts
0
Views
1.3k
Activity
Sep ’22
NEPacketTunnelProvider can't get device's packets
Hi, I'm new in this area. I have several questions to ask. I'm implementing a vpn client by using NETunnelProviderProtocol(). After I start the tunnel successfully, I can't get any packets from self.packetFlow.readPacketObjects. Is the NETunnelProviderProtocol able to gather the packet from whole device ?(just work like a normal vpn client) Is it safe to turn includeAllNetworks() to true? thanks
Replies
15
Boosts
0
Views
1.1k
Activity
May ’21
enforceRoutes causes excludedRoutes to be ignored
In our PacketTunnelProvider we are seeing behavior for enforceRoutes which appears to contradict the documentation. According to the developer documentation (my emphasis): If this property is YES when the includeAllNetworks property is NO, the system scopes the included routes to the VPN and the excluded routes to the current primary network interface. If we set these IPv4 settings: IPv4Settings = { configMethod = manual addresses = ( 172.16.1.1, ) subnetMasks = ( 255.255.255.255, ) includedRoutes = ( { destinationAddress = 0.0.0.0 destinationSubnetMask = 0.0.0.0 }, ) excludedRoutes = ( { destinationAddress = 10.10.0.0 destinationSubnetMask = 255.255.255.0 }, ) overridePrimary = YES } Then if enforceRoutes is set to YES, then we do not see traffic for the excluded network, which is the expected behavior. If enforceRoutes is set to NO, then we do see traffic for the excluded network. In both cases includeAllNetworks and excludeLocalNetworks are both NO. The excluded network is not one of the
Replies
6
Boosts
0
Views
1.6k
Activity
May ’23
split Tunnel + exclude APNs
Hello, im currently developing proxy app with XrayCore trying to bypass APNs when tunnel us up and i found .excludeAPNs property in NETunnelProviderProtocol that works only when includeAllNetworks property is also TRUE. I wonder if there is a possible way to make APNs bypass tunnel in split tunnelling mode? because we use excludedRoutes and full tunnel is not an option
Replies
1
Boosts
0
Views
143
Activity
May ’25
Configuring Routing network traffic properties
Requirement: We need to update below tunnel provider properties once VPN is up. Is it possible? includeAllNetworks excludeLocalNetworks enforceRoutes When is the standard time to configure and save the below properties in system preferences? Is it possible to save these properties in system preference when VPN is up? saveToPreferencesWithCompletionHandler If we can change these properties in VPN connected state, When these tunnel provider properties will come into effect?
Replies
1
Boosts
0
Views
574
Activity
Mar ’24