Home Explore Blog CI



docker

5th chunk of `content/manuals/engine/daemon/troubleshoot.md`
151f1608497b9c9c42cacabac87087ad173e6737be02f8dc0000000100000c90
   $ sudo systemctl stop dnsmasq
   $ sudo systemctl disable dnsmasq
   ```

2. Configure the DNS servers manually using the
   [Red Hat documentation](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/configuring_and_managing_networking/configuring-the-order-of-dns-servers_configuring-and-managing-networking).

{{< /tab >}}
{{< /tabs >}}

### Docker networks disappearing

If a Docker network, such as the `docker0` bridge or a custom network, randomly
disappears or otherwise appears to be working incorrectly, it could be because
another service is interfering with or modifying Docker interfaces. Tools that
manage networking interfaces on the host are known to sometimes also
inappropriately modify Docker interfaces.

Refer to the following sections for instructions on how to configure your
network manager to set Docker interfaces as un-managed, depending on the
network management tools that exist on the host:

- If `netscript` is installed, consider [uninstalling it](#uninstall-netscript)
- Configure the network manager to [treat Docker interfaces as un-managed](#un-manage-docker-interfaces)
- If you're using Netplan, you may need to [apply a custom Netplan configuration](#prevent-netplan-from-overriding-network-configuration)

#### Uninstall `netscript`

If `netscript` is installed on your system, you can likely fix this issue by
uninstalling it. For example, on a Debian-based system:

```console
$ sudo apt-get remove netscript-2.4
```

#### Un-manage Docker interfaces

In some cases, the network manager will attempt to manage Docker interfaces by
default. You can try to explicitly flag Docker networks as un-managed by
editing your system's network configuration settings.

{{< tabs >}}
{{< tab name="NetworkManager" >}}

If you're using `NetworkManager`, edit your system network configuration under
`/etc/network/interfaces`

1. Create a file at `/etc/network/interfaces.d/20-docker0` with the following
   contents:

   ```text
   iface docker0 inet manual
   ```

   Note that this example configuration only "un-manages" the default `docker0`
   bridge, not custom networks.

2. Restart `NetworkManager` for the configuration change to take effect.

   ```console
   $ systemctl restart NetworkManager
   ```

3. Verify that the `docker0` interface has the `unmanaged` state.

   ```console
   $ nmcli device
   ```

{{< /tab >}}
{{< tab name="systemd-networkd" >}}

If you're running Docker on a system using `systemd-networkd` as a networking
daemon, configure the Docker interfaces as un-managed by creating configuration
files under `/etc/systemd/network`:

1. Create `/etc/systemd/network/docker.network` with the following contents:

   ```ini
   # Ensure that the Docker interfaces are un-managed

   [Match]
   Name=docker0 br-* veth*

   [Link]
   Unmanaged=yes

   ```

2. Reload the configuration.

   ```console
   $ sudo systemctl restart systemd-networkd
   ```

3. Restart the Docker daemon.

   ```console
   $ sudo systemctl restart docker
   ```

4. Verify that the Docker interfaces have the `unmanaged` state.

   ```console
   $ networkctl
   ```

{{< /tab >}}
{{< /tabs >}}

### Prevent Netplan from overriding network configuration

Title: Troubleshooting Disappearing Docker Networks and Interference from Network Management Tools
Summary
This section discusses issues where Docker networks disappear or malfunction due to interference from other services that manage network interfaces. It provides solutions, including uninstalling `netscript` on Debian-based systems and configuring network managers (NetworkManager and systemd-networkd) to treat Docker interfaces as unmanaged. Specific instructions are given for creating configuration files and restarting relevant services to apply the changes. The section also mentions preventing Netplan from overriding network configurations.