---
title: Packet tunnel provider
framework: networkextension
role: collectionGroup
role_heading: API Collection
path: networkextension/packet-tunnel-provider
---

# Packet tunnel provider

Implement a VPN client for a packet-oriented, custom VPN protocol.

## Overview

Overview A virtual private network (VPN) is a form of network tunnel where a VPN client uses the public Internet to create a connection to a VPN server and then passes private network traffic over that connection. If you want to build a VPN client that implements a packet-oriented, custom VPN protocol, create a packet tunnel provider app extension. When the system starts a VPN configuration that uses your packet tunnel provider, it performs the following steps: Launches your app extension. Instantiates your packet tunnel provider subclass within that app extension. Starts forwarding packets to your provider. Your provider should open a tunnel to a VPN server and send those packets over that tunnel. Similarly, if your provider receives packets from the tunnel, it should pass them back to the system. Packet tunnel providers can run in destination IP mode or source-application mode. The latter is one form of per-app VPN (the other form is an App proxy provider). For detailed information about packet tunnel provider deployment options, see TN3134: Network Extension provider deployment. note: When a VPN configuration is active, connections use the VPN instead of iCloud Private Relay. Network Extension providers also don’t use iCloud Private Relay.

## Topics

### Essentials

- [Network Extensions Entitlement](bundleresources/entitlements/com.apple.developer.networking.networkextension.md)

### Packet tunnel provider

- [NEPacketTunnelProvider](networkextension/nepackettunnelprovider.md)
- [NETunnelProvider](networkextension/netunnelprovider.md)
- [NEProvider](networkextension/neprovider.md)
- [NEPacketTunnelNetworkSettings](networkextension/nepackettunnelnetworksettings.md)
- [NETunnelNetworkSettings](networkextension/netunnelnetworksettings.md)
- [NEEthernetTunnelProvider](networkextension/neethernettunnelprovider.md)
- [NEEthernetTunnelNetworkSettings](networkextension/neethernettunnelnetworksettings.md)

### Packet handling

- [NEPacketTunnelFlow](networkextension/nepackettunnelflow.md)
- [NEPacket](networkextension/nepacket.md)
- [In-Provider Networking](networkextension/in-provider-networking.md)

### VPN configuration

- [NETunnelProviderManager](networkextension/netunnelprovidermanager.md)
- [NEVPNManager](networkextension/nevpnmanager.md)
- [NETunnelProviderProtocol](networkextension/netunnelproviderprotocol.md)
- [NEAppRule](networkextension/neapprule.md)
- [VPN On Demand Rules](networkextension/vpn-on-demand-rules.md)

### VPN control

- [NETunnelProviderSession](networkextension/netunnelprovidersession.md)
- [NEVPNConnection](networkextension/nevpnconnection.md)

## See Also

### Virtual private networks

- [Routing your VPN network traffic](networkextension/routing-your-vpn-network-traffic.md)
- [Personal VPN](networkextension/personal-vpn.md)
- [App proxy provider](networkextension/app-proxy-provider.md)
