An abstract base class shared by NEPacketTunnelProvider and NEAppProxyProvider.


class NETunnelProvider : NEProvider


Each NETunnelProvider instance corresponds to a single tunneling session, with a single associated configuration.

Subclassing Notes

The NETunnelProvider class should not be subclassed directly. Instead, you should create subclasses of NETunnelProvider subclasses.

Methods to Override


Getting the Tunnel Configuration

var protocolConfiguration: NEVPNProtocol

The configuration of the current tunneling session.

var routingMethod: NETunnelProviderRoutingMethod

The method by which network traffic is routed to the tunnel.

var appRules: [NEAppRule]?

The app rules dictating which apps will use the current tunneling session.

Configuring the Tunnel Interface

Communicating with the Containing App

func handleAppMessage(Data, completionHandler: ((Data?) -> Void)?)

Handle messages sent by the tunnel provider extension’s containing app

Setting Tunnel Status

var reasserting: Bool

Indicate to the system that the tunnel is being re-established.


Inherits From

Conforms To

See Also

Packet Tunnel Provider

class NEPacketTunnelProvider

The principal class for a packet tunnel provider app extension.

class NEProvider

An abstract base class for all NetworkExtension providers.

class NEPacketTunnelNetworkSettings

The configuration for a packet tunnel provider’s virtual interface.

class NETunnelNetworkSettings

The configuration for a tunnel provider’s virtual interface.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software