#53765·Docker

Overlay MTU is 20 bytes too large on an IPv6 Swarm data path

Author: corhereCreated Sep 24, 2026Updated Sep 24, 2026
Labelskind/bugarea/networkingarea/networking/ipv6area/networking/d/overlay

Description

The overlay driver sets a container's overlay interface MTU to the network's base MTU (1500 unless com.docker.network.driver.mtu is set) minus a fixed 50-byte VXLAN allowance. The allowance assumes an IPv4 outer header. On an IPv6 Swarm data path the overhead is 70 bytes:

Header Allowance IPv6 data path
Inner Ethernet 14 14
Outer IP 20 40
UDP 8 8
VXLAN 8 8
Total 50 70

The container's MTU is therefore 20 bytes larger than the path can carry.

On a 1500-byte underlay the container's interface MTU is 1450, but with the don't-fragment bit set only packets up to 1430 bytes cross between nodes. Anything sized to the interface MTU, TCP's MSS included, is 20 bytes too large for the path.

In my test the 1450-byte DF send failed with EMSGSIZE because the sending container's kernel had already learned the lower path MTU. Full-size packets depend on path MTU discovery to get through.

Reproduce

  1. Two Linux hosts with IPv6 connectivity to each other, on a network with a 1500-byte MTU.
  2. On host 1: docker swarm init --advertise-addr <host1-ipv6>
  3. On host 2: docker swarm join --advertise-addr <host2-ipv6> --token <token> [<host1-ipv6>]:2377
  4. On host 1:
    bash
    docker network create -d overlay --attachable ov
    docker run -d --name target --network ov alpine sleep infinity
  5. On host 2:
    bash
    docker run --rm --network ov alpine sh -c '
      cat /sys/class/net/eth0/mtu
      apk add -q iputils
      ping -c1 -W2 -M do -s 1402 target  # 1430-byte IP packet
      ping -c1 -W2 -M do -s 1422 target  # 1450-byte IP packet
    '

The interface MTU is 1450. The first ping gets a reply. The second fails.

An IPv4 control plane with an IPv6 --data-path-addr gives the same result.

Expected behavior

The overlay interface MTU is the largest packet that crosses the data path: 1430 on a 1500-byte IPv6 underlay.

docker version

The bug is in every release since v25.0.0, which added IPv6 data-path support (#46790), and on master.

docker info

The bug does not depend on the environment beyond an IPv6 data-path address.

Additional Info

  • The allowance is vxlanEncap = 50 in daemon/libnetwork/drivers/overlay/overlay.go. It is subtracted in (*network).maxMTU, which sets both the VXLAN link's MTU and the container's interface MTU. The kernel's allowance for VXLAN over IPv6 is 70 bytes (VXLAN6_HEADROOM).
  • Encrypted overlays subtract the same allowance before the ESP overhead. On an IPv6 data path they should get an MTU of 1424 where the path fits 1404 (1500 − 70 − 26). I have not measured this.
  • Workaround: create the network with com.docker.network.driver.mtu set 20 bytes below the underlay MTU, e.g. --opt com.docker.network.driver.mtu=1480 on a 1500-byte underlay. The allowance is subtracted from that value, giving 1430, or 1404 on an encrypted network.
  • setupSubnetSandbox calls isIPv6Transport() to configure the VXLAN link for IPv6 peers. maxMTU could choose its allowance the same way.