Skip to content

macvlan: "failed to set IPv6 gateway: file exists" on network connect #50898

@robmry

Description

@robmry

Description

Reported in community Slack, but the user doesn't wish to share details here.

Broadly - with a container attached to one macvlan network, connect it to a second network, disconnect the first network, then re-connect. Some/most of the time, the final re-connect fails with:

Error response from daemon: updating gateway endpoint: failed to set IPv6 gateway: file exists

Reproduce

I'm able to reliably repro the error in a macvlan network connected to a network with a router, using:

docker network create -d macvlan --ipv4=false --ipv6 --subnet fdf0:a9dd:e362:b301::/64 -o parent=enp0s1 mv1
docker network create -d macvlan --ipv4=false --ipv6 --subnet fdf0:a9dd:e362:b364::/64 -o parent=enp0s1 mv2
docker run --rm -d --network mv1 --ip6 fdf0:a9dd:e362:b301::1234 --name c1 busybox sleep infinity
docker network connect mv2 c1 --ip6 fdf0:a9dd:e362:b364::1234
sleep 2
docker network disconnect mv1 c1
sleep 2
docker network connect mv1 c1 --ip6 fdf0:a9dd:e362:b301::1234

But, can't repro in a dev container - I think Docker's gateway assignment is racing IPv6 autoconfig.

Expected behavior

No response

docker version

28.3.3 or current-latest master, on a Debian Trixie VM with a bridged network.

docker info

.

Additional Info

No response

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions