NSX-V3 Add NO-DNAT rules only if supported
Commit I34d72b12289d6f6527bc114a32dac88281dd2cc4 added NO_DNAT rules for each router interface. Those rules are not supported and unnecessary for older NSX versions as VLAN networks were not supported with routers. This commit adds the NO_DNAT rules only when supported. Depends-on: I4d99193caac6940911cc071016359a1361428967 Change-Id: Ic0934979931e20645ee1d7d6b5968d7d3efc9c01
This commit is contained in:
parent
9d99e2ffb6
commit
163dd0b214
@ -3525,17 +3525,21 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
|
|||||||
def _add_subnet_no_dnat_rule(self, context, nsx_router_id, subnet):
|
def _add_subnet_no_dnat_rule(self, context, nsx_router_id, subnet):
|
||||||
# Add NO-DNAT rule to allow internal traffic between VMs, even if
|
# Add NO-DNAT rule to allow internal traffic between VMs, even if
|
||||||
# they have floating ips
|
# they have floating ips
|
||||||
self.nsxlib.logical_router.add_nat_rule(
|
if self.nsxlib.feature_supported(
|
||||||
nsx_router_id, "NO_DNAT", None,
|
nsxlib_consts.FEATURE_NO_DNAT_NO_SNAT):
|
||||||
dest_net=subnet['cidr'],
|
self.nsxlib.logical_router.add_nat_rule(
|
||||||
rule_priority=nsxlib_router.GW_NAT_PRI)
|
nsx_router_id, "NO_DNAT", None,
|
||||||
|
dest_net=subnet['cidr'],
|
||||||
|
rule_priority=nsxlib_router.GW_NAT_PRI)
|
||||||
|
|
||||||
def _del_subnet_no_dnat_rule(self, context, nsx_router_id, subnet):
|
def _del_subnet_no_dnat_rule(self, context, nsx_router_id, subnet):
|
||||||
# Delete the previously created NO-DNAT rules
|
# Delete the previously created NO-DNAT rules
|
||||||
self.nsxlib.logical_router.delete_nat_rule_by_values(
|
if self.nsxlib.feature_supported(
|
||||||
nsx_router_id,
|
nsxlib_consts.FEATURE_NO_DNAT_NO_SNAT):
|
||||||
action="NO_DNAT",
|
self.nsxlib.logical_router.delete_nat_rule_by_values(
|
||||||
match_destination_network=subnet['cidr'])
|
nsx_router_id,
|
||||||
|
action="NO_DNAT",
|
||||||
|
match_destination_network=subnet['cidr'])
|
||||||
|
|
||||||
def _process_extra_attr_router_create(self, context, router_db, r):
|
def _process_extra_attr_router_create(self, context, router_db, r):
|
||||||
for extra_attr in l3_attrs_db.get_attr_info().keys():
|
for extra_attr in l3_attrs_db.get_attr_info().keys():
|
||||||
|
Loading…
Reference in New Issue
Block a user