Skip to content

Commit 17552fc

Browse files
authored
Merge pull request moby#51542 from robmry/rootless-noipv6
rootless: ignore error when enabling IPv6 forwarding
2 parents a81d441 + 5c9f2e0 commit 17552fc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

contrib/dockerd-rootless.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,10 @@ else
228228
# When running with --firewall-backend=nftables, IP forwarding needs to be enabled
229229
# because the daemon won't enable it. IP forwarding is harmless in the rootless
230230
# netns, there's only a single external interface and only Docker uses the netns.
231-
# So, always enable IPv4 and IPv6 forwarding.
231+
# So, always enable IPv4 and IPv6 forwarding. But ignore failure to enable IPv6
232+
# forwarding, for hosts with IPv6 disabled.
232233
sysctl -w net.ipv4.ip_forward=1
233-
sysctl -w net.ipv6.conf.all.forwarding=1
234+
sysctl -w net.ipv6.conf.all.forwarding=1 || true
234235

235236
exec "$dockerd" "$@"
236237
fi

0 commit comments

Comments
 (0)