How to enable ipv6 support in docker

In a standard setup, docker will not assign ipv6 addresses to its containers. So if it is necessary to use ipv6 networking inside a docker container, you have to enable it manually, first.

Suggested on host ipv6 support in the docker host, Edit for create the file /etc/docker/daemon.json and enable ipv6:

{
  “ipv6”: true,
  “fixed-cidr-v6”: “fd00::/80”
}

Be aware, that in addition to the official docker documentation we are specifing a fixed private ipv6 network here. Otherwise we would receive the following error message:

ERROR: could not find an available, non-overlapping IPv6 address pool among the defaults to assign to the network

ip6tables -t nat -A POSTROUTING -s fd01::/80 -o eth0 -j MASQUERADE