IPv6 iptables config option
Sebastiaan van Stijn authored on 2020/12/07 19:59:42... | ... |
@@ -34,6 +34,7 @@ func installConfigFlags(conf *config.Config, flags *pflag.FlagSet) error { |
34 | 34 |
flags.BoolVar(&conf.EnableSelinuxSupport, "selinux-enabled", false, "Enable selinux support") |
35 | 35 |
flags.Var(opts.NewNamedUlimitOpt("default-ulimits", &conf.Ulimits), "default-ulimit", "Default ulimits for containers") |
36 | 36 |
flags.BoolVar(&conf.BridgeConfig.EnableIPTables, "iptables", true, "Enable addition of iptables rules") |
37 |
+ flags.BoolVar(&conf.BridgeConfig.EnableIP6Tables, "ip6tables", false, "Enable addition of ip6tables rules") |
|
37 | 38 |
flags.BoolVar(&conf.BridgeConfig.EnableIPForward, "ip-forward", true, "Enable net.ipv4.ip_forward") |
38 | 39 |
flags.BoolVar(&conf.BridgeConfig.EnableIPMasq, "ip-masq", true, "Enable IP masquerading") |
39 | 40 |
flags.BoolVar(&conf.BridgeConfig.EnableIPv6, "ipv6", false, "Enable IPv6 networking") |
... | ... |
@@ -54,6 +54,7 @@ type BridgeConfig struct { |
54 | 54 |
// Fields below here are platform specific. |
55 | 55 |
EnableIPv6 bool `json:"ipv6,omitempty"` |
56 | 56 |
EnableIPTables bool `json:"iptables,omitempty"` |
57 |
+ EnableIP6Tables bool `json:"ip6tables,omitempty"` |
|
57 | 58 |
EnableIPForward bool `json:"ip-forward,omitempty"` |
58 | 59 |
EnableIPMasq bool `json:"ip-masq,omitempty"` |
59 | 60 |
EnableUserlandProxy bool `json:"userland-proxy,omitempty"` |
... | ... |
@@ -746,6 +746,9 @@ func verifyDaemonSettings(conf *config.Config) error { |
746 | 746 |
if !conf.BridgeConfig.EnableIPTables && !conf.BridgeConfig.InterContainerCommunication { |
747 | 747 |
return fmt.Errorf("You specified --iptables=false with --icc=false. ICC=false uses iptables to function. Please set --icc or --iptables to true") |
748 | 748 |
} |
749 |
+ if conf.BridgeConfig.EnableIP6Tables && !conf.Experimental { |
|
750 |
+ return fmt.Errorf("ip6tables rules are only available if experimental features are enabled") |
|
751 |
+ } |
|
749 | 752 |
if !conf.BridgeConfig.EnableIPTables && conf.BridgeConfig.EnableIPMasq { |
750 | 753 |
conf.BridgeConfig.EnableIPMasq = false |
751 | 754 |
} |
... | ... |
@@ -911,6 +914,7 @@ func driverOptions(config *config.Config) []nwconfig.Option { |
911 | 911 |
bridgeConfig := options.Generic{ |
912 | 912 |
"EnableIPForwarding": config.BridgeConfig.EnableIPForward, |
913 | 913 |
"EnableIPTables": config.BridgeConfig.EnableIPTables, |
914 |
+ "EnableIP6Tables": config.BridgeConfig.EnableIP6Tables, |
|
914 | 915 |
"EnableUserlandProxy": config.BridgeConfig.EnableUserlandProxy, |
915 | 916 |
"UserlandProxyPath": config.BridgeConfig.UserlandProxyPath} |
916 | 917 |
bridgeOption := options.Generic{netlabel.GenericData: bridgeConfig} |