From 57010acc3ac69d0448d58a2d90d12076db14d29e Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Sun, 24 Sep 2017 00:21:56 -0700 Subject: [PATCH] NSX|V: do not build NAT rules for v6 networks NSX does not support IPv6 NAT rules Change-Id: I50d3ebc6c27cc0afeb7d148c941ad5fa1b365e49 --- vmware_nsx/plugins/common/plugin.py | 3 ++- vmware_nsx/plugins/nsx_v/plugin.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/vmware_nsx/plugins/common/plugin.py b/vmware_nsx/plugins/common/plugin.py index a24c6e720e..f26147b58a 100644 --- a/vmware_nsx/plugins/common/plugin.py +++ b/vmware_nsx/plugins/common/plugin.py @@ -180,7 +180,8 @@ class NsxPluginBase(db_base_plugin_v2.NeutronDbPluginV2, subnet_qry = context.session.query(models_v2.Subnet) subnet = subnet_qry.filter_by(id=ip.subnet_id).one() subnets.append({'id': subnet.id, 'cidr': subnet.cidr, - 'subnetpool_id': subnet.subnetpool_id}) + 'subnetpool_id': subnet.subnetpool_id, + 'ip_version': subnet.ip_version}) return subnets def _find_router_gw_subnets(self, context, router): diff --git a/vmware_nsx/plugins/nsx_v/plugin.py b/vmware_nsx/plugins/nsx_v/plugin.py index 6b6192df7c..e4dfb3119a 100644 --- a/vmware_nsx/plugins/nsx_v/plugin.py +++ b/vmware_nsx/plugins/nsx_v/plugin.py @@ -3322,7 +3322,9 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin, subnets = self._find_router_subnets(context.elevated(), router['id']) for subnet in subnets: - + # Do not build NAT rules for v6 + if subnet.get('ip_version') == 6: + continue # if the subnets address scope is the same as the gateways: # no need for SNAT gw_address_scope = self._get_network_address_scope(