Docker Community Forums

Share and learn in the Docker community.

Is it possible Configure IPv6 for pools used by docker internal networks?

Hi all,

I deployed a docker composed based solution on a customer’s premises.
The customer is a campus with a big network.
They got back to me asking why a part of their internal network was not able to access
the docker powered service. Turns out a subnet in the campus has the same address as a docker
network: 172.19.0.0/16.

My idea to solve this was to ask which network they plan to never assign to any machine in the campus and go with it.
But I was told they are keeping all addresses reserved for future allocation.
The only way for me to use any private address at all is to ask them to reserve it for me.
But they require me to ask as few addresses as possible for allocation.

Given all this I’m wondering if I can have docker use IPv6 for its networks.
That would solve my problems.

Otherwise my fear is that I’ll ask them to allocate just enough addresses for today, but in the future
this might byte me when I deploy new versions of our software, which might have an additional service requiring an additional address.

So the question is: is it possible to have docker only use IPv6 for its networks? If it is, can someone provide some pointers?
Thanks!

Before you can use IPv6 in Docker containers or swarm services, you need to enable IPv6 support in the Docker daemon. Afterward, you can choose to use either IPv4 or IPv6 (or both) with any container, service, or network.

Note: IPv6 networking is only supported on Docker daemons running on Linux hosts.

Edit /etc/docker/daemon.json, set the ipv6 key to true and the fixed-cidr-v6 key to your IPv6 subnet. In this example we are setting it to 2001:db8:1::/64.

{
“ipv6”: true,
“fixed-cidr-v6”: “2001:db8:1::/64”
}
Save the file.

Reload the Docker configuration file.

$ systemctl reload docker
You can now create networks with the --ipv6 flag and assign containers IPv6 addresses using the --ip6 flag.