---
title: stopTunnel()
framework: networkextension
role: symbol
role_heading: Instance Method
path: networkextension/netunnelprovidersession/stoptunnel()
---

# stopTunnel()

Start the process of disconnecting the tunnel.

## Declaration

```swift
func stopTunnel()
```

## Discussion

Discussion This method returns immediately after starting the process of disconnecting the tunnel. In order to be notified when the tunnel is fully disconnected, register to observe the NEVPNStatusDidChangeNotification notification on the NETunnelProviderSession object and examine its status property when the notification is received.

## See Also

### Controlling the tunnel connection

- [startTunnel(options:)](networkextension/netunnelprovidersession/starttunnel(options:).md)
