diff --git a/neutron/agent/linux/iptables_manager.py b/neutron/agent/linux/iptables_manager.py index 000b676b27b..128a704fd4f 100644 --- a/neutron/agent/linux/iptables_manager.py +++ b/neutron/agent/linux/iptables_manager.py @@ -497,6 +497,10 @@ class IptablesManager(object): version = self._get_version() self.__class__._random_fully = utils.is_version_greater_equal( version, n_const.IPTABLES_RANDOM_FULLY_VERSION) + + self._random_fully = self._random_fully and \ + cfg.CONF.AGENT.use_random_fully + return self._random_fully @property diff --git a/neutron/conf/agent/common.py b/neutron/conf/agent/common.py index 139c2d54eef..8d2957a00d9 100644 --- a/neutron/conf/agent/common.py +++ b/neutron/conf/agent/common.py @@ -135,6 +135,9 @@ IPTABLES_OPTS = [ "of iptables-save. This option should not be turned " "on for production systems because it imposes a " "performance penalty.")), + cfg.BoolOpt('use_random_fully', + default=True, + help=_("Use random-fully in SNAT masquerade rules.")), ] PROCESS_MONITOR_OPTS = [ diff --git a/releasenotes/notes/use_random_fully-527b20bc524c308a.yaml b/releasenotes/notes/use_random_fully-527b20bc524c308a.yaml new file mode 100644 index 00000000000..76fb36590c2 --- /dev/null +++ b/releasenotes/notes/use_random_fully-527b20bc524c308a.yaml @@ -0,0 +1,15 @@ +--- +features: + - | + Add ``use_random_fully`` setting to allow an operator to disable + the iptables random-fully property on an iptable rules. +issues: + - | + If the ``use_random_fully`` setting is disabled, it will prevent + random fully from being used and if there're 2 guests in different + networks using the same source_ip and source_port and they try to + reach the same dest_ip and dest_port, packets might be dropped in + the kernel do to the racy tuple generation . Disabling this + setting should only be done if source_port is really important such + as in network firewall ACLs and that the source_ip are never repeating + within the platform.