Open hemna opened 2 years ago
Same as yours..
-o ipv6
will use DHCPv6 to obtain ipv6 address. However, for router it is often the case that ipv6 address is obtained through SLAAC
, and is configured by kernel itself instead of docker-net-dhcp
's udhcpc6
.
When router is configured to be Stateless DHCPv6
, DHCPv6 is just used to fetch information like DNS servers, but not IPv6 address, thus will result in the error failed to get initial IP address via DHCP
.
To obtain an ipv6 address, either to use Stateful DHCPv6
with configured IPv6 address pool (then use -o ipv6=true to use udhcpc6), or use linux kernel's automatic SLAAC configuration (with -o ipv6=false or not set).
However, for docker container's SLAAC to work, you need to modify some sysctl options, because automatic SLAAC is disabled for docker's deault sysctl setting (see https://github.com/docker/for-linux/issues/1373). There are two ways to fix it:
my bridge interface works fine, as it has a dhcp6 address from my /64 subnet.