<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEVPNProtocol",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEVPNProtocol"
  },
  "title" : "NEVPNProtocol"
}
-->

# NEVPNProtocol

Settings common to both IKEv2 and IPsec VPN configurations.

```
class NEVPNProtocol
```

## Overview

The [`NEVPNProtocol`](/documentation/NetworkExtension/NEVPNProtocol) class is an abstract base class with one subclass for each type of supported VPN configuration. This class provides properties for configuring the VPN, authenticating network connections, and routing network traffic. You can include all network traffic, with some exceptions, and selectively exclude types of network traffic.

Instances of this class are thread-safe.

## Topics

### Configuring the VPN

[`serverAddress`](/documentation/NetworkExtension/NEVPNProtocol/serverAddress)

The address of the VPN server.

[`disconnectOnSleep`](/documentation/NetworkExtension/NEVPNProtocol/disconnectOnSleep)

A Boolean value that indicates whether the VPN disconnects when the device sleeps.

[`proxySettings`](/documentation/NetworkExtension/NEVPNProtocol/proxySettings)

The proxy settings to use for HTTP and HTTPS connections that route through the VPN.

### Authenticating the user

[`username`](/documentation/NetworkExtension/NEVPNProtocol/username)

The user name component of the tunneling protocol authentication credential.

[`passwordReference`](/documentation/NetworkExtension/NEVPNProtocol/passwordReference)

A persistent keychain reference to a keychain item containing the password component of the tunneling protocol authentication credential.

[`identityReference`](/documentation/NetworkExtension/NEVPNProtocol/identityReference)

A persistent keychain reference to a keychain item containing the certificate and private key components of the tunneling protocol authentication credential.

[`identityData`](/documentation/NetworkExtension/NEVPNProtocol/identityData)

The certificate and private key components of the tunneling protocol authentication credential, in PKCS12 format.

[`identityDataPassword`](/documentation/NetworkExtension/NEVPNProtocol/identityDataPassword)

The password for the PKCS12 tunneling protocol authentication credentials.

### Routing network traffic

[`includeAllNetworks`](/documentation/NetworkExtension/NEVPNProtocol/includeAllNetworks)

A Boolean value that indicates whether the system sends most network traffic over the tunnel.

[`excludeAPNs`](/documentation/NetworkExtension/NEVPNProtocol/excludeAPNs)

A Boolean value that indicates whether the system excludes all APNs network traffic from the tunnel.

[`excludeCellularServices`](/documentation/NetworkExtension/NEVPNProtocol/excludeCellularServices)

A Boolean value that indicates whether the system excludes all cellular services network traffic from the tunnel.

[`excludeLocalNetworks`](/documentation/NetworkExtension/NEVPNProtocol/excludeLocalNetworks)

A Boolean value that indicates whether the system excludes all traffic destined for local networks from the tunnel.

[`enforceRoutes`](/documentation/NetworkExtension/NEVPNProtocol/enforceRoutes)

A Boolean value that indicates whether route rules for the tunnel take precedence over any locally defined routes.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Equatable`](/documentation/Swift/Equatable)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

### Inherited By

[`NEVPNProtocolIPSec`](/documentation/NetworkExtension/NEVPNProtocolIPSec)

[`NEDNSProxyProviderProtocol`](/documentation/NetworkExtension/NEDNSProxyProviderProtocol)

[`NETunnelProviderProtocol`](/documentation/NetworkExtension/NETunnelProviderProtocol)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)