Use default ULA prefix if fixed-cidr-v6 is not specified

Use the same logic to generate IPAMConf for IPv6 as for IPv4.

- When no fixed-cidr-v6 is specified, rather than error out, use
  the default address pools (as for an IPv4 default bridge with no
  fixed-cidr, and as for user-defined networks).
- Add daemon option --bip6, similar to --bip.
  - Necessary because it's the only way to override an old address
    on docker0 (daemon-managed default bridge), as illustrated by
    test cases.
- For a user-managed default bridge (--bridge), use IPv6 addresses
  on the user's bridge to determine the pool, sub-pool and gateway.
  Following the same rules as IPv4.
- Don't set up IPv6 IPAMConf if IPv6 is not enabled.

Signed-off-by: Rob Murray <rob.murray@docker.com>
This commit is contained in:
Rob Murray
2024-08-10 20:03:21 +01:00
parent fdd2591cbe
commit 0b5b1db1c1
7 changed files with 277 additions and 182 deletions

View File

@@ -10,6 +10,7 @@ dockerd - Enable daemon mode
[**--authorization-plugin**[=*[]*]]
[**-b**|**--bridge**[=*BRIDGE*]]
[**--bip**[=*BIP*]]
[**--bip6**[=*BIP*]]
[**--cgroup-parent**[=*[]*]]
[**--config-file**[=*path*]]
[**--containerd**[=*SOCKET-PATH*]]
@@ -146,7 +147,11 @@ $ sudo dockerd --add-runtime runc=runc --add-runtime custom=/usr/local/bin/my-ru
container networking
**--bip**=""
Use the provided CIDR notation address for the dynamically created bridge
Use the provided CIDR notation IPv4 address for the dynamically created bridge
(docker0); Mutually exclusive of \-b
**--bip6**=""
Use the provided CIDR notation IPv6 address for the dynamically created bridge
(docker0); Mutually exclusive of \-b
**--cgroup-parent**=""