Docker Community Forums

Share and learn in the Docker community.

Starting Docker with IPv6 Kills my IPv6 Connection

Struggling to figure out this problem. On a CentOS 7 host, I start the docker daemon with --ipv6 --fixed-cidr-v6="2001:db8:a:b:1::/80" and all IPv6 connectivity to/from the host dies.

With docker running, from the host running Docker a ping6 -c 3 ipv6.google.com gives:

PING ipv6.google.com(ya-in-x64.1e100.net (2607:f8b0:4002:c03::64)) 56 data bytes
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable

To get IPv6 working again, I stop dockerd then issue a systemctl restart network to reset the network interfaces. Interestingly that the docker0 network interface remains, but the IPv6 network works after the systemctl restart network

Anyone seen this issue before? The host has a static /64 IPv6 address. I am using the server’s actual IPv6 /64 address (not 2001:db8 as shown above), and giving Docker a /80 space within the host’s /64 network. I have done this before on a CentOS 6 host, without any problems. That one got its IPv6 addressing automatically from its router, though (not statically set like this one is)

The CentOS version is 7.3.1611, Docker version 1.12.3. Sysctl settings:

net.ipv6.conf.default.forwarding=1
net.ipv6.conf.all.forwarding=1
net.ipv6.conf.eth0.accept_ra=2

I also tried net.ipv6.conf.eth0.accept_ra setting of 0 and 1.

I want to use IPv6 because it gives me direct routing to containers without using NAT.

I ran across this today and there is a similar issue reported here: Docker CE deletes IPv6 Default route · Issue #844 · docker/for-linux · GitHub

The problem is because the default IPv6 route is missing.

After adding net.ipv6.conf.ens160.accept_ra=2 to /etc/sysctl.conf, applying the sysctl changes, restarting Docker, and networking, the default route was maintained and the container had IPv6 connectivity.

1 Like