NSX|V: do not build NAT rules for v6 networks

NSX does not support IPv6 NAT rules

Change-Id: I50d3ebc6c27cc0afeb7d148c941ad5fa1b365e49
This commit is contained in:
Gary Kotton 2017-09-24 00:21:56 -07:00
parent 5a8b1c0131
commit 57010acc3a
2 changed files with 5 additions and 2 deletions

View File

@ -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):

View File

@ -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(