Netplan conf - my Docker containers lose access to the Internet

Hi everyone,

I have two dedicated servers at OVH, and I’m trying to switch an additional IP (used for my PRI) from one server to the other.

The target server is running Debian 12 with Netplan, and it hosts several Docker stacks behind a Traefik reverse proxy.

Based on the following two OVH documentation pages:

…I came up with this Netplan configuration:

network:
  version: 2
  ethernets:
    enp8s0f0:
      match:
        macaddress: d8:43:ae:8a:df:a6
      set-name: enp8s0f0
      addresses:
        - 192.168.0.3/24
        - xx.xxx.xx.xx/32         # Main IP
        - yy.yy.yyy.yy/32         # Additional IP to switch
      dhcp4: true
      routes:
        - to: default
          via: 192.168.0.1

Problem: with this setup, my Docker containers lose access to the Internet.

Does anyone have a clue or suggestion to restore Docker’s network access in this configuration?

Thanks in advance!

You could check all the IP addresses of containers. Or at least the Docker networks. Although Docker usually starts with IPs like 172.17.x.x, it could also use 10.x.x.x or 192.168.x.x. If you chose an IP not compatible with Docker networks, that could cause a problem.

There were also cases when someone configured multiple networks and the priority of the default routes were wrong which affected the Docker network. If you have multiple default routes (maybe defined in other files), you can try to check what happens when you leave only one termporarily.