-
Notifications
You must be signed in to change notification settings - Fork 7.7k
engine/networking overhaul #17176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
engine/networking overhaul #17176
Conversation
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
c5ad914
to
1b14ec3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need a section in the firewalling docs about iptables-nftables. Currently, dockerd only supports iptables-legacy
. On some OS, users have to explicitly switch to that (by creating the proper symlink, or by using update-alternatives
) or dockerd might break in unexpected ways (including at startup).
6fd5cfa
to
277a4e7
Compare
69b40b9
to
c90454b
Compare
File location changes in docker/docs#17176 Signed-off-by: David Karlsson <david.karlsson@docker.com>
@dvdksn The command shown in $ docker run --rm --network none alpine:latest ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 EDIT: maybe we can actually add this command too and add a note that say no IPv6 loopback address is configured when using
|
8be47f6
to
2ff2b15
Compare
@akerouanton ptal! |
I can't edit the original description, so let me dump links to related issues here:
@thaJeztah ISTR we closed an issue not so long ago about IPv6 resolver ending up in containers' |
@akerouanton @thaJeztah I don't think we should add anything more to this PR -- so unless you have any change requests I suggest we get this merged. I have couple of follow-ups to come. |
config/daemon/ipv6.md
Outdated
The `ipv6` and `fixed-cidr-v6` parameters are optional. | ||
They assign an IPv6 subnet to the default bridge network. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My grammar isn't great, so I could be mistaken if a comma properly connects the two statements 😅
The `ipv6` and `fixed-cidr-v6` parameters are optional. | |
They assign an IPv6 subnet to the default bridge network. | |
The `ipv6` and `fixed-cidr-v6` parameters are optional, | |
they assign an IPv6 subnet to the default bridge network. |
config/daemon/ipv6.md
Outdated
``` | ||
|
||
Upon restart, the daemon assigns IPv6 addresses to containers connected to the | ||
default bridge network, and to user-defined networks configured with an IPv6 subnet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users need to set default-address-pools
to let the daemon assign IPv6 addresses to their custom network automatically (as described below).
default bridge network, and to user-defined networks configured with an IPv6 subnet. | |
default bridge network. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users need to set
default-address-pools
to let the daemon assign IPv6 addresses
docker network create --ipv6 --subnet fd00:d0ca::/112
?
You can assign an IPv6 subnet explicitly for user-defined networks without default-address-pools
being adjusted.
The statement doesn't say anything about automatically configuring IPv6 subnet for a user-defined network, just that containers with a user-defined network that has already been configured with an IPv6 subnet would enable the container to be assigned an IPv6 address from it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The statement doesn't say anything about automatically configuring IPv6 subnet for a user-defined network
It talks about automatically assigning IPv6 addresses to containers:
Upon restart, the daemon assigns IPv6 addresses to containers connected [...] to user-defined networks configured with an IPv6 subnet.
My point is: experimental
and ip6tables
are needed to have the same experience with IPv6 as with IPv4 (wrt. isolation & port mapping), whether users rely on static or dyanmic allocation. But ipv6
and fixed-cidr-v6
are only required to let the daemon assign IPv6 addresses to containers connected to the default bridge network. Above options won't turn on dynamic allocation for custom networks, hence my suggestion.
Given the state of IPv6 support currently, and the fact old networking mode (with the default bridge) still exist, I also prefer to just tell users to configure ipv6
and fixed-cidr-v6
such that the default bridge and custom networks just work the same way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It talks about automatically assigning IPv6 addresses to containers:
Which is correct. That happens when the network (default bridge, or user-defined nework) has IPv6 subnet already configured?
My point is:
experimental
andip6tables
are needed to have the same experience with IPv6 as with IPv4 (wrt. isolation & port mapping), whether users rely on static or dyanmic allocation.
Yes these two settings are quite important. It's unfortunate ip6tables
remains opt-in while userland-proxy: true
is the default due to surprises that causes on an IPv6 host even when docker networks are IPv4 only.
Above options won't turn on dynamic allocation for custom networks, hence my suggestion.
I tried to communicate this distinction earlier in review, the two settings from the earlier JSON snippet could belong in their own section that enables IPv6 for the default (legacy) bridge.
A section that follows after it could then cover the same for user-defined networks with an explicit subnet given with docker network create
or in the compose.yaml
. After that, you detail implicit subnet assignment which almost works like creating IPv4 networks, but still requires opt-in for IPv6 (--ipv6
/ enable_ipv6: true
).
I also prefer to just tell users to configure
ipv6
andfixed-cidr-v6
such that the default bridge and custom networks just work the same way.
I understand :)
I just think it's worth the distinction that the two settings are optional, only related to enabling the support on the bridge. Some users aren't aware of that in the past and think it's required even when using compose.yaml
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which is correct. That happens when the network (default bridge, or user-defined nework) has IPv6 subnet already configured?
Right, but that's unrelated to the daemon parameters we're advertising in this section.
I tried to communicate this distinction earlier in review, the two settings from the earlier JSON snippet could belong in their own section that enables IPv6 for the default (legacy) bridge.
Got you. @dvdksn WDYT about what @polarathene proposes:
- Adding a section dedicated to the default bridge and moving
ipv6
andfixed-cidr-v6
there ; - Adding a section dedicated to static allocation ;
We can discuss this proposal on Slack if you're unsure what should go in these new sections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, I think this would help clear things up. I'll give it it a go!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ptal 2be681d
config/daemon/ipv6.md
Outdated
``` | ||
|
||
Upon restart, the daemon assigns IPv6 addresses to containers connected to the | ||
default bridge network, and to user-defined networks configured with an IPv6 subnet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The statement doesn't say anything about automatically configuring IPv6 subnet for a user-defined network
It talks about automatically assigning IPv6 addresses to containers:
Upon restart, the daemon assigns IPv6 addresses to containers connected [...] to user-defined networks configured with an IPv6 subnet.
My point is: experimental
and ip6tables
are needed to have the same experience with IPv6 as with IPv4 (wrt. isolation & port mapping), whether users rely on static or dyanmic allocation. But ipv6
and fixed-cidr-v6
are only required to let the daemon assign IPv6 addresses to containers connected to the default bridge network. Above options won't turn on dynamic allocation for custom networks, hence my suggestion.
Given the state of IPv6 support currently, and the fact old networking mode (with the default bridge) still exist, I also prefer to just tell users to configure ipv6
and fixed-cidr-v6
such that the default bridge and custom networks just work the same way.
config/daemon/ipv6.md
Outdated
> **Note** | ||
> | ||
> Be aware that the following known limitations exist: | ||
> | ||
> - Supernets can't have a size larger than 80. This is due to an integer | ||
> overflow in the Docker daemon. See | ||
> [moby/moby#42801](https://github.com/moby/moby/issues/42801) | ||
> - The difference between the supernet length and the pool size can't be | ||
> larger than 24. Otherwise, the daemon consumes all available memory. See | ||
> [moby/moby#40275](https://github.com/moby/moby/issues/40275) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can create a pool of subnets larger than 2^24, it just depends on the memory the system has available.
You can, but it grows exponentially. A difference of 24 bits between the pool size and the desired subnet size already consumes 250MiB. 28 bits will consume 4GiB and 32 bits, 64GiB. Hence my initial recommendation I asked @dvdksn to put here.
Also, I prefer to precisely describe the limitation instead of vaguely stating it, as the latter case implies users have to discover it by themselves.
Containers that attach to the default `bridge` network receive a copy of this file. | ||
Containers that attach to a | ||
[custom network](network-tutorial-standalone.md#use-user-defined-bridge-networks) | ||
use Docker's embedded DNS server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dvdksn Can you add an item on your todo list about that please ⬆️?
59ad176
to
742edfe
Compare
742edfe
to
584b15f
Compare
Signed-off-by: David Karlsson <david.karlsson@docker.com>
Signed-off-by: David Karlsson <david.karlsson@docker.com>
Ports published on the localhost IP are still accessible by other systems connected to the same local network. Signed-off-by: David Karlsson <david.karlsson@docker.com>
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com> Signed-off-by: David Karlsson <david.karlsson@docker.com>
Signed-off-by: David Karlsson <david.karlsson@docker.com>
- One section for using IPv6 with custom networks - One section for using IPv6 with the default bridge Signed-off-by: David Karlsson <david.karlsson@docker.com>
584b15f
to
2be681d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; are there commits that need to be squashed before merging? (the rename commits probably must be kept separate)
also kept one comment about the "experimental" part, but we can look at that in a follow-up (I think we need to slightly make that more clear)
File location changes in docker/docs#17176 Signed-off-by: David Karlsson <david.karlsson@docker.com> (cherry picked from commit 035e26f) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Proposed changes
Complete overhaul of networking documentation: drivers, ipv6, iptables/firewalls