a straight-forward approach
https://dnschecker.org/ipv6-address-generator.php
This example input:
Global ID: 0000000000
Subnet ID: 0000
will result in:
Name | Value |
---|---|
Prefix / L | fd |
Global ID | 0000000000 |
Subnet ID | 0000 |
Network | fd00:: |
CIDR | fd00::/64 |
IPv6 Address Format | fd00:0000:0000:0000:XXXX:XXXX:XXXX:XXXX |
Start Range | fd00:0000:0000:0000:0000:0000:0000:0000 |
End Range | fd00:0000:0000:0000:ffff:ffff:ffff:ffff |
Block Size | 18446744073709551616 |
That is 2^64 addresses
https://subnettingpractice.com/ipv6-subnet-calculator.html
Goal is to split the /64 subnet to smaller subnets
My personal split logic:
IPv6 | Total IP Addresses | Split |
---|---|---|
/64 | 2^64 (18,446,744,073,709,551,616) | 64k subnets of size /80 |
/80 | 2^48 (281,474,976,710,656) | 64k subnets of size /96 |
/96 | 2^32 (4,294,967,296) | - |
IPv6 | IPv4 | Total IP Addresses | Split |
---|---|---|---|
/96 | * | 2^32 (4,294,967,296) | 256 subnets of size /104 (IPv4:/8) |
/104 | /8 (x.*) | 2^24 (16,777,216) | 256 subnets of size /112 (IPv4:/16) |
/112 | /16 (x.x.*) | 2^16 (65,536) | 256 subnets of size /120 (IPv4:/24) |
/120 | /24 (x.x.x.*) | 2^8 (256) | - |
https://docs.docker.com/config/daemon/ipv6/
Check: Local subnets should all be unique and not overlapping!
Important: At the moment this document is released IPv6 is still experimental
Hint "mixed environments":
I personally encountered problems in mixed environments.
Example: Traefik Network IPv6 with other networks still running in IPv4.
Above resulted in containers (sometimes/random!) not being able to reach each other.
Declaring all networks to v6 seems to do the trick!
{
"ipv6": true,
"fixed-cidr": "172.16.0.0/16",
"fixed-cidr-v6": "fd00::16:0/112",
"experimental": true,
"ip6tables": true,
"default-address-pools": [
{
"base": "172.17.0.0/16",
"size": 24
},
{
"base": "fd00::17:0/112",
"size": 120
}
]
}
1 subnet - 65,636 addresses in total
172.16.0.0/16 (65,536 addresses)
fd00::16:0/112 (65,536 addresses)
256 subnets x 256 addresses (65,636 addresses in total)
172.17.0.0/16 (65,536 addresses) split to /24 (256 addresses)
fd00::17:0/112 (65,536 addresses) split to /120 (256 addresses)
networks:
name:
enable_ipv6: true
example:
172.18.0.0/16
fd00::18:0/112
docker network create --ipv6 --subnet 172.18.0.0/16 --subnet fd00::18:0/112 networkname
example:
172.18.0.0/24, 172.18.1.0/24, 172.18.2.0/24 ...
fd00::18:0/120, fd00::18:100/120, fd00::18:200/120 ...
docker network create --ipv6 --subnet 172.18.0.0/24 --subnet fd00::18:0/120 networkname
docker network create --ipv6 --subnet 172.18.1.0/24 --subnet fd00::18:100/120 networkname
docker network create --ipv6 --subnet 172.18.2.0/24 --subnet fd00::18:200/120 networkname
...
https://en.wikipedia.org/wiki/Reserved_IP_addresses
https://docs.docker.com/config/daemon/ipv6/
https://dnschecker.org/ipv6-address-generator.php
https://docs.netgate.com/pfsense/en/latest/network/ipv6/subnets.html