# Disconnecting shows "Connection failed" (Linux / NetworkManager)

When disconnecting from a location on a Linux system with `NetworkManager` installed, a **"Connection failed"** system notification appears. This is a visual bug only — the VPN connection itself is not affected.

The error occurs because `NetworkManager` attempts to manage the WireGuard network interfaces created by Defguard. When those interfaces are removed on disconnect, `NetworkManager` reports a failure.

### Fix

Tell `NetworkManager` to ignore all interfaces created by Defguard. Defguard tunnel interfaces are prefixed with `wg` by default.

**1. Create the config file:**

```sh
sudo nano /etc/NetworkManager/conf.d/90-defguard.conf
```

**2. Add the following content:**

```ini
[keyfile]
unmanaged-devices=interface-name:wg*
```

**3. Save and restart `NetworkManager`:**

```sh
sudo systemctl restart NetworkManager
```

The notification will no longer appear after this change.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.defguard.net/support-1/troubleshooting-guides/desktop-client/disconnecting-shows-connection-failed-linux-networkmanager.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
