Skip to content

Commit 85cf2b7

Browse files
robmrydvdksn
authored andcommitted
network: Updates to IPv6 address pools
- a ULA prefix is used if there's no IPv6 in default-address-pools - restrictions on IPv6 subnet size and number of pools have been removed Signed-off-by: Rob Murray <[email protected]>
1 parent 6db7163 commit 85cf2b7

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

content/config/daemon/ipv6.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ IPv6 is only supported on Docker daemons running on Linux hosts.
1212

1313
- Using `docker network create`:
1414

15+
```console
16+
$ docker network create --ipv6 ip6net
17+
```
18+
19+
- Using `docker network create`, specifying an IPv6 subnet:
20+
1521
```console
1622
$ docker network create --ipv6 --subnet 2001:db8::/64 ip6net
1723
```
@@ -43,8 +49,9 @@ Hostname: ea1cfde18196
4349
IP: 127.0.0.1
4450
IP: ::1
4551
IP: 172.17.0.2
52+
IP: 2001:db8::2
4653
IP: fe80::42:acff:fe11:2
47-
RemoteAddr: [fe80::42:acff:fe11:2]:54890
54+
RemoteAddr: [2001:db8::1]:37574
4855
GET / HTTP/1.1
4956
Host: [::1]
5057
User-Agent: curl/8.1.2
@@ -94,8 +101,9 @@ Hostname: ea1cfde18196
94101
IP: 127.0.0.1
95102
IP: ::1
96103
IP: 172.17.0.2
97-
IP: fe80::42:acff:fe11:2
98-
RemoteAddr: [fe80::42:acff:fe11:2]:54890
104+
IP: 2001:db8:1::242:ac12:2
105+
IP: fe80::42:acff:fe12:2
106+
RemoteAddr: [2001:db8:1::1]:35558
99107
GET / HTTP/1.1
100108
Host: [::1]
101109
User-Agent: curl/8.1.2
@@ -107,11 +115,16 @@ Accept: */*
107115
If you don't explicitly configure subnets for user-defined networks,
108116
using `docker network create --subnet=<your-subnet>`,
109117
those networks use the default address pools of the daemon as a fallback.
110-
The default address pools are all IPv4 pools.
111118
This also applies to networks created from a Docker Compose file,
112119
with `enable_ipv6` set to `true`.
113120

114-
To enable dynamic subnet allocation for user-defined IPv6 networks,
121+
If no IPv6 pools are included in Docker Engine's `default-address-pools`,
122+
and no `--subnet` option is given, [Unique Local Addresses (ULAs)][wikipedia-ipv6-ula]
123+
will be used when IPv6 is enabled. These `/64` subnets include a 40-bit
124+
Global ID based on the Docker Engine's randomly generated ID, to give a
125+
high probability of uniqueness.
126+
127+
To use different pools of IPv6 subnets for dynamic address allocation,
115128
you must manually configure address pools of the daemon to include:
116129

117130
- The default IPv4 address pools
@@ -135,20 +148,7 @@ The default address pool configuration is:
135148

136149
The following example shows a valid configuration with the default values and
137150
an IPv6 pool. The IPv6 pool in the example provides up to 256 IPv6 subnets of
138-
size `/112`, from an IPv6 pool of prefix length `/104`. Each `/112`-sized
139-
subnet supports 65 536 IPv6 addresses.
140-
141-
> **Note**
142-
>
143-
> Be aware that the following known limitations exist for IPv6 pools:
144-
>
145-
> - The `base` value for IPv6 needs a minimum prefix length of `/64`.
146-
> This is due to an integer overflow in the Docker daemon.
147-
> See [moby/moby#42801](https://github.com/moby/moby/issues/42801).
148-
> - The difference between the pool length and the pool size can't be larger
149-
> than 24. Defining an excessive number of subnets causes the daemon to
150-
> consume all available memory.
151-
> See [moby/moby#40275](https://github.com/moby/moby/issues/40275).
151+
size `/64`, from an IPv6 pool of prefix length `/56`.
152152

153153
```json
154154
{
@@ -160,18 +160,19 @@ subnet supports 65 536 IPv6 addresses.
160160
{ "base": "172.24.0.0/14", "size": 16 },
161161
{ "base": "172.28.0.0/14", "size": 16 },
162162
{ "base": "192.168.0.0/16", "size": 20 },
163-
{ "base": "2001:db8::/104", "size": 112 }
163+
{ "base": "2001:db8::/56", "size": 64 }
164164
]
165165
}
166166
```
167167

168168
> **Note**
169169
>
170-
> The address `2001:db8` in this example is
170+
> The address `2001:db8::` in this example is
171171
> [reserved for use in documentation][wikipedia-ipv6-reserved].
172172
> Replace it with a valid IPv6 network.
173+
>
173174
> The default IPv4 pools are from the private address range,
174-
> the IPv6 equivalent would be [ULA networks][wikipedia-ipv6-ula].
175+
> similar to the default IPv6 [ULA][wikipedia-ipv6-ula] networks.
175176

176177
[wikipedia-ipv6-reserved]: https://en.wikipedia.org/wiki/Reserved_IP_addresses#IPv6
177178
[wikipedia-ipv6-ula]: https://en.wikipedia.org/wiki/Unique_local_address

0 commit comments

Comments
 (0)