Skip to content

rootless: enable IPv6 in RootlessKit network namespace#5055

Open
Akshitguptaa wants to merge 1 commit into
containerd:mainfrom
Akshitguptaa:ipv6-rootless-2608
Open

rootless: enable IPv6 in RootlessKit network namespace#5055
Akshitguptaa wants to merge 1 commit into
containerd:mainfrom
Akshitguptaa:ipv6-rootless-2608

Conversation

@Akshitguptaa

Copy link
Copy Markdown

Adds CONTAINERD_ROOTLESS_ROOTLESSKIT_IPV6=(true|false) to enable IPv6 inside the
RootlessKit network namespace, wired through to rootlesskit --ipv6.

  • Documented in docs/rootless.md
  • Wired into hack/test-integration-rootless.sh for CI opt-in
  • TestRunContainerWithStaticIP6 now runs under rootless when the flag is set

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

Signed-off-by: akshitguptaa <akshitguptaa29@gmail.com>
@AkihiroSuda AkihiroSuda added the area/rootless Rootless mode label Jul 9, 2026
Comment thread docs/rootless.md
* `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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

# 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).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't mention a PR that has been abandoned and unlikely going to be merged

systemctl --user daemon-reload
fi

if [ "${CONTAINERD_ROOTLESS_ROOTLESSKIT_IPV6:-false}" = "true" ]; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem set in CI

}

// RootlessKitIPv6Enabled reports whether the running RootlessKit parent process was launched with --ipv6.
func RootlessKitIPv6Enabled() bool {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is not needed as it has been supported since v0.14

Comment thread docs/rootless.md
* `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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work with pasta too? (--net=pasta --port-driver=implicit)

}

// RootlessKitIPv6Enabled reports whether the running RootlessKit parent process was launched with --ipv6.
func RootlessKitIPv6Enabled() bool {

@AkihiroSuda AkihiroSuda Jul 9, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider moving this to testutil pkg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/rootless Rootless mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support IPv6 in rootless

2 participants