---
title: "startVPNTunnel(options:)"
framework: networkextension
role: symbol
role_heading: Instance Method
path: "networkextension/nevpnconnection/startvpntunnel(options:)"
---

# startVPNTunnel(options:)

Start the process of connecting the VPN.

## Declaration

```swift
func startVPNTunnel(options: [String : NSObject]? = nil) throws
```

## Parameters

- `options`: An NSDictionary that will be passed to the tunnel provider during the process of starting the tunnel. See Constants, below.

## Discussion

Discussion This method returns immediately after starting the process of connecting the VPN. In order to be notified when the VPN is fully connected, register to observe the NEVPNStatusDidChangeNotification notification on the NEVPNConnection object, and examine the status property when the notification is received. note: In Swift, this method returns Void and is marked with the throws keyword to indicate that it throws an error in cases of failure. You call this method in a try expression and handle any errors in the catch clauses of a do statement, as described in Error Handling in The Swift Programming Language and About Imported Cocoa Error Parameters.

## See Also

### Controlling the VPN connection

- [startVPNTunnel()](networkextension/nevpnconnection/startvpntunnel().md)
- [NEVPNConnectionStartOptionUsername](networkextension/nevpnconnectionstartoptionusername.md)
- [NEVPNConnectionStartOptionPassword](networkextension/nevpnconnectionstartoptionpassword.md)
- [stopVPNTunnel()](networkextension/nevpnconnection/stopvpntunnel().md)
