Search code examples
iosnevpnmanager

What is the difference between NEVPNManager and NETunnelProvider?


I'm trying to find out what's the difference between the two. I get the NETunnel is for ssl-vpn's and custom vpn's, but can they still be used interchangeably? Can I use NETunnel to connect to an IPSec VPN?

My main need is to set my dns for the VPN, but I can't seem to do it with NEVPN


Solution

  • NEVPNManager is designed to control VPNs based on one of the built-in VPN plug-in types. NETunnelProviderManager is designed to control custom VPN plug-ins (and requires a special entitlement for those plug-ins).

    Normally, with most VPNs, you would change the DNS on the other end of the VPN tunnel, by having the actual VPN server send a list of DNS server IPs to the client, this making that a server configuration detail, rather than something the app itself would need to control. NETunnelProviderManager offers that ability because it is designed to handle arbitrary VPN types that might not work that way.