I am using Ubuntu 18.04 on DigitalOcean, with IPv6 turned on:
PUBLIC IPV6 ADDRESS:
xxxx:xxxx:2:d0::216f:3001
PUBLIC IPV6 GATEWAY:
xxxx:xxxx:2:d0::1
CONFIGURABLE ADDRESS RANGE:
xxxx:xxxx:2:d0::216f:3000 - xxxx:xxxx:2:d0::216f:300f
According to this page: https://docs.docker.com/v17.09/engine/userguide/networking/default_network/ipv6/#docker-ipv6-cluster
Is it correct to put the 16 IPv6 addresses like this?
{
"ipv6": true,
"fixed-cidr-v6": "xxxx:xxxx:2:d0::216f:3000/124"
}
Or, is it just fine to use these (as if something like 192.168.0.x)?
{
"ipv6": true,
"fixed-cidr-v6": "2001:db8::c008/125"
}
Anyway I have tried the first one.
docker run -d --name ipv6test alpine ash -c "ping6 2606:4700:4700::1111"
I "docker inspect" for the IPv6 address. I make the NDP record:
ip -6 neigh add proxy xxxx:xxxx:2:d0::216f:3004 dev eth0
In this case, the container could communicate with the outside world.
Testing finished. I want to apply IPv6 to my project. It starts with docker-compose.
According to this page: https://docs.docker.com/compose/compose-file/#ipv4_address-ipv6_address
version: "3.7"
services:
app:
image: nginx:alpine
networks:
app_net:
ipv6_address: xxxx:xxxx:2:d0::216f:3010
networks:
app_net:
ipam:
driver: default
config:
- subnet: "xxxx:xxxx:2:d0::216f:3000/124"
Inside the container, no connection could be made:
# ping6 2606:4700:4700::1111
PING 2606:4700:4700::1111 (2606:4700:4700::1111): 56 data bytes
ping6: sendto: Address not available
Have I missed anything?
Thanks.