---
title: "startTunnel(options:)"
framework: networkextension
role: symbol
role_heading: Instance Method
path: "networkextension/netunnelprovidersession/starttunnel(options:)"
---

# startTunnel(options:)

Start the process of connecting the tunnel.

## Declaration

```swift
func startTunnel(options: [String : Any]? = nil) throws
```

## Parameters

- `options`: A dictionary containing options to be passed to the Tunnel Provider extension.

## Discussion

Discussion This method returns immediately after starting the process of connecting the tunnel. In order to be notified when the tunnel is fully connected, register to observe the NEVPNStatusDidChangeNotification notification on the NETunnelProviderSession object and examine its 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 tunnel connection

- [stopTunnel()](networkextension/netunnelprovidersession/stoptunnel().md)
