We are developing a split tunnel based VPN application (PacketTunnel) for macOS using NetworkExtension and SystemExtension. We are currently assessing whether there could be any problems or limitations with multiple VPN tunnels (from different apps) running simultaneously that could cause any traffic routing conflict or any other problems. So here are the scenarios that we have questions about?
- Is it possible to have multiple
NEPacketTunnelProvider
based tunnels running at the same time which are created by different applications? - Is it possible to have one
NEPacketTunnelProvider
based VPN and one kext based VPN tunnel running at the same time? We are planning on supporting from macOS Catalina. - Assuming answer to first question is, yes, what would be the behaviour if there is include route overlap between two
NEPacketTunnelProvider
based VPN tunnels? - Assuming answer to second question is, yes, what would be the behaviour if there is include route overlap between our
NEPacketTunnelProvider
based VPN tunnel and other kext based VPN tunnel? - Is there a way to create custom VPN tunnel or utun interface, from an app, apart from suing NetworkExtension or kext, in macOS? Could that cause a route overlap or conflict with our NetworkExtension tunnel when running simultaneously?
- Is there a way to find out tunnel address, match domains and include routes of other VPN tunnels or utun interfaces created by other applications? This may help us use different include routes than existing tunnels and avoid route overlap.
- Is there a way to create a VPN profile using
NETunnelProviderManager
which is not visible inSystem Preferences -> Network Preferences
likeNETransparentProxyManager
which are not visible sinceBig Sur
?
Thanks in advance for your response.
Is there a way to create custom VPN tunnel or utun interface, from an app, apart from using NetworkExtension or KEXT, in macOS?
This is something you will need to research on your own. This is not something I would recommend or provide help with either as it is way off the beaten path of what is considered to be supported.
Regarding:
Is there a way to find out tunnel address, match domains and include routes of other VPN tunnels or utun interfaces created by other applications (kext or NE or any other way)? This may help us do some tricks with include routes and avoid route overlap. netstat -rn seems to be one way to get some of this information. Is there any better way?
On macOS, yes, there is. Have a look at the SCDynamicStore APIs for rounding up this related information. It may not give you everything, but it should give you a good amount of information about other system configurations. (Note that this is not available on iOS. I realize that you are not targeting macOS, but others targeting iOS do ask this question)
Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com