Home Explore Blog CI



docker

6th chunk of `content/manuals/engine/daemon/troubleshoot.md`
899523a9600826328a095170bbb9c6f26f57a63833148240000000010000084e
   ```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

On systems that use [Netplan](https://netplan.io/) through
[`cloud-init`](https://cloudinit.readthedocs.io/en/latest/index.html), you may
need to apply a custom configuration to prevent `netplan` from overriding the
network manager configuration:

1. Follow the steps in [Un-manage Docker interfaces](#un-manage-docker-interfaces)
   for creating the network manager configuration.
2. Create a `netplan` configuration file under `/etc/netplan/50-cloud-init.yml`.

   The following example configuration file is a starting point.
   Adjust it to match the interfaces you want to un-manage.
   Incorrect configuration can lead to network connectivity issues.

   ```yaml {title="/etc/netplan/50-cloud-init.yml"}
   network:
     ethernets:
       all:
         dhcp4: true
         dhcp6: true
         match:
           # edit this filter to match whatever makes sense for your system
           name: en*
     renderer: networkd
     version: 2
   ```

3. Apply the new Netplan configuration.

   ```console
   $ sudo netplan apply
   ```

4. Restart the Docker daemon:

   ```console
   $ sudo systemctl restart docker

Title: Preventing Netplan from Overriding Network Configuration for Docker
Summary
This section describes how to prevent Netplan from overriding network manager configurations on systems using Netplan via cloud-init. It involves creating a custom Netplan configuration file (e.g., `/etc/netplan/50-cloud-init.yml`) with settings adjusted to match the desired interfaces, applying the new Netplan configuration using `sudo netplan apply`, and restarting the Docker daemon. It emphasizes following the steps for un-managing Docker interfaces first and provides a sample configuration file as a starting point, while cautioning against incorrect configurations that may lead to network connectivity issues.