Skip to content

Error when updating IPv6 gateway #1142

@robbertkl

Description

@robbertkl

For IPv4 I've noticed that when connected to multiple (user-defined) networks, NAT and gateway are always configured for the network with the alphabetically lowest network name (see #1141).

If a running container gets connected to a new network (docker network connect <network> <container>), and this network's name comes before the current "gateway network", the default gateway in the controller is changed to the new network's gateway. This, however, does not work for IPv6:

docker network create --ipv6 --subnet=fd00:aaa::/48 aaa
docker network create --ipv6 --subnet=fd00:bbb::/48 bbb

docker run -d --name=test1 --net=aaa alpine sleep 10
docker network connect bbb test1
# no problem here, because it keeps gateway of "aaa"

docker run -d --name=test2 --net=bbb alpine sleep 10
docker network connect aaa test2
Error response from daemon: failed to set IPv6 gateway while updating gateway: file exists
# this breaks, cannot change gateway from "bbb" to "aaa"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions