---
title: NETunnelProvider
framework: networkextension
role: symbol
role_heading: Class
path: networkextension/netunnelprovider
---

# NETunnelProvider

An abstract base class shared by NEPacketTunnelProvider and NEAppProxyProvider.

## Declaration

```swift
class NETunnelProvider
```

## Mentioned in

Routing your VPN network traffic

## Overview

Overview Each NETunnelProvider instance corresponds to a single tunneling session, with a single associated configuration. important: The com.apple.developer.networking.networkextension entitlement is required in order to use the NETunnelProvider class. Enable this entitlement when creating an App ID in your developer account. Subclassing Notes The NETunnelProvider class should not be subclassed directly. Instead, you should create subclasses of NETunnelProvider subclasses. Methods to Override handleAppMessage(_:completionHandler:)

## Topics

### Getting the tunnel configuration

- [protocolConfiguration](networkextension/netunnelprovider/protocolconfiguration.md)
- [routingMethod](networkextension/netunnelprovider/routingmethod.md)
- [appRules](networkextension/netunnelprovider/apprules.md)

### Configuring the tunnel interface

- [setTunnelNetworkSettings(_:completionHandler:)](networkextension/netunnelprovider/settunnelnetworksettings(_:completionhandler:).md)

### Communicating with the containing app

- [handleAppMessage(_:completionHandler:)](networkextension/netunnelprovider/handleappmessage(_:completionhandler:).md)

### Setting tunnel status

- [reasserting](networkextension/netunnelprovider/reasserting.md)

### Errors

- [NETunnelProviderError.Code](networkextension/netunnelprovidererror-swift.struct/code.md)
- [NETunnelProviderErrorDomain](networkextension/netunnelprovidererrordomain.md)
- [NETunnelProviderError.Code](networkextension/netunnelprovidererror-swift.struct/code.md)

## Relationships

### Inherits From

- [NEProvider](networkextension/neprovider.md)

### Inherited By

- [NEAppProxyProvider](networkextension/neappproxyprovider.md)
- [NEPacketTunnelProvider](networkextension/nepackettunnelprovider.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### App proxy provider

- [NEAppProxyProvider](networkextension/neappproxyprovider.md)
- [NEProvider](networkextension/neprovider.md)
- [NETunnelNetworkSettings](networkextension/netunnelnetworksettings.md)
