diff --git a/docs/containers.conf.5.md b/docs/containers.conf.5.md index 1cdc6403c..9d887fa7e 100644 --- a/docs/containers.conf.5.md +++ b/docs/containers.conf.5.md @@ -467,7 +467,7 @@ and pods are visible. Path to the slirp4netns binary. -**network_cmd_options**=[] +**network_cmd_options**=["enable_ipv6=true",] Default options to pass to the slirp4netns binary. diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 481f5d190..5336c20c3 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -163,6 +163,10 @@ var _ = Describe("Config", func() { "TERM=xterm", } + networkCmdOptions := []string{ + "enable_ipv6=true", + } + helperDirs := []string{ "/somepath", } @@ -176,6 +180,7 @@ var _ = Describe("Config", func() { gomega.Expect(defaultConfig.Engine.NumLocks).To(gomega.BeEquivalentTo(2048)) gomega.Expect(defaultConfig.Engine.OCIRuntimes).To(gomega.Equal(OCIRuntimeMap)) gomega.Expect(defaultConfig.Containers.HTTPProxy).To(gomega.Equal(false)) + gomega.Expect(defaultConfig.Engine.NetworkCmdOptions).To(gomega.BeEquivalentTo(networkCmdOptions)) gomega.Expect(defaultConfig.Engine.HelperBinariesDir).To(gomega.Equal(helperDirs)) }) diff --git a/pkg/config/containers.conf b/pkg/config/containers.conf index fc61ed709..60f094ccd 100644 --- a/pkg/config/containers.conf +++ b/pkg/config/containers.conf @@ -422,7 +422,7 @@ default_sysctls = [ # Default options to pass to the slirp4netns binary. # For example "allow_host_loopback=true" # -#network_cmd_options = [] +#network_cmd_options = ["enable_ipv6=true",] # Whether to use chroot instead of pivot_root in the runtime # diff --git a/pkg/config/default.go b/pkg/config/default.go index db5ba6936..be6072b2e 100644 --- a/pkg/config/default.go +++ b/pkg/config/default.go @@ -256,7 +256,9 @@ func defaultConfigFromMemory() (*EngineConfig, error) { c.CgroupManager = defaultCgroupManager() c.StopTimeout = uint(10) - + c.NetworkCmdOptions = []string{ + "enable_ipv6=true", + } c.Remote = isRemote() c.OCIRuntimes = map[string][]string{ "crun": {