From 5c9f2e0388804a972685128f50c2e7ecbc467a0c Mon Sep 17 00:00:00 2001 From: Rob Murray Date: Sun, 16 Nov 2025 11:49:49 +0000 Subject: [PATCH] rootless: ignore error when enabling IPv6 forwarding For hosts with IPv6 disabled. Signed-off-by: Rob Murray --- contrib/dockerd-rootless.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/dockerd-rootless.sh b/contrib/dockerd-rootless.sh index 3f981acdcc..a5d13d02e3 100755 --- a/contrib/dockerd-rootless.sh +++ b/contrib/dockerd-rootless.sh @@ -228,9 +228,10 @@ else # When running with --firewall-backend=nftables, IP forwarding needs to be enabled # because the daemon won't enable it. IP forwarding is harmless in the rootless # netns, there's only a single external interface and only Docker uses the netns. - # So, always enable IPv4 and IPv6 forwarding. + # So, always enable IPv4 and IPv6 forwarding. But ignore failure to enable IPv6 + # forwarding, for hosts with IPv6 disabled. sysctl -w net.ipv4.ip_forward=1 - sysctl -w net.ipv6.conf.all.forwarding=1 + sysctl -w net.ipv6.conf.all.forwarding=1 || true exec "$dockerd" "$@" fi