rootless: enable IPv6 in RootlessKit network namespace#5055
Open
Akshitguptaa wants to merge 1 commit into
Open
rootless: enable IPv6 in RootlessKit network namespace#5055Akshitguptaa wants to merge 1 commit into
Akshitguptaa wants to merge 1 commit into
Conversation
Signed-off-by: akshitguptaa <akshitguptaa29@gmail.com>
AkihiroSuda
reviewed
Jul 9, 2026
| * `CONTAINERD_ROOTLESS_ROOTLESSKIT_IPV6=(true|false)`: whether to enable IPv6 inside the RootlessKit network namespace. | ||
| Defaults to "false". After enabling this, create IPv6-capable CNI networks with | ||
| `nerdctl network create --ipv6 --subnet <v6-subnet>` as usual. Published ports over IPv6 are | ||
| supported with `--port-driver=builtin` (the default). `--port-driver=slirp4netns` does not yet |
Member
There was a problem hiding this comment.
Suggested change
| supported with `--port-driver=builtin` (the default). `--port-driver=slirp4netns` does not yet | |
| supported with `--port-driver=builtin` (the default). Other port drivers do not yet |
AkihiroSuda
reviewed
Jul 9, 2026
| # Defaults to "false". Requires a RootlessKit network driver that supports IPv6 (slirp4netns >= v0.4.0 with an | ||
| # IPv6-capable build). When using `--port-driver=slirp4netns`, published ports over IPv6 additionally require | ||
| # IPv6 support in slirp4netns's port driver, which is not yet available upstream | ||
| # (see https://github.com/rootless-containers/slirp4netns/pull/276). |
Member
There was a problem hiding this comment.
Don't mention a PR that has been abandoned and unlikely going to be merged
AkihiroSuda
reviewed
Jul 9, 2026
| systemctl --user daemon-reload | ||
| fi | ||
|
|
||
| if [ "${CONTAINERD_ROOTLESS_ROOTLESSKIT_IPV6:-false}" = "true" ]; then |
AkihiroSuda
reviewed
Jul 9, 2026
| } | ||
|
|
||
| // RootlessKitIPv6Enabled reports whether the running RootlessKit parent process was launched with --ipv6. | ||
| func RootlessKitIPv6Enabled() bool { |
Member
There was a problem hiding this comment.
Member
There was a problem hiding this comment.
Maybe you should rather add IPv6 bool in https://github.com/rootless-containers/rootlesskit/blob/v3.0.1/pkg/api/api.go#L22
AkihiroSuda
reviewed
Jul 9, 2026
| case "$CONTAINERD_ROOTLESS_ROOTLESSKIT_IPV6" in | ||
| 1 | true) | ||
| if ! rootlesskit --help | grep -qw -- "--ipv6"; then | ||
| echo "CONTAINERD_ROOTLESS_ROOTLESSKIT_IPV6=true requires a RootlessKit build that supports --ipv6" |
Member
There was a problem hiding this comment.
This check is not needed as it has been supported since v0.14
AkihiroSuda
reviewed
Jul 9, 2026
| * `CONTAINERD_ROOTLESS_ROOTLESSKIT_IPV6=(true|false)`: whether to enable IPv6 inside the RootlessKit network namespace. | ||
| Defaults to "false". After enabling this, create IPv6-capable CNI networks with | ||
| `nerdctl network create --ipv6 --subnet <v6-subnet>` as usual. Published ports over IPv6 are | ||
| supported with `--port-driver=builtin` (the default). `--port-driver=slirp4netns` does not yet |
Member
There was a problem hiding this comment.
Does it work with pasta too? (--net=pasta --port-driver=implicit)
AkihiroSuda
reviewed
Jul 9, 2026
| } | ||
|
|
||
| // RootlessKitIPv6Enabled reports whether the running RootlessKit parent process was launched with --ipv6. | ||
| func RootlessKitIPv6Enabled() bool { |
Member
There was a problem hiding this comment.
Consider moving this to testutil pkg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds CONTAINERD_ROOTLESS_ROOTLESSKIT_IPV6=(true|false) to enable IPv6 inside the
RootlessKit network namespace, wired through to
rootlesskit --ipv6.Scope: covers --port-driver=builtin (the default). --port-driver=slirp4netns
does not yet support IPv6 port forwarding upstream
(rootless-containers/slirp4netns#276 is still open), so that path remains
unsupported here.
Fixes #2608