sudo87 commented on code in PR #13200:
URL: https://github.com/apache/cloudstack/pull/13200#discussion_r4203071681
##########
server/src/main/java/com/cloud/network/router/CommandSetupHelper.java:
##########
@@ -463,6 +464,25 @@ public void createApplyStaticNatRulesCommands(final List<?
extends StaticNatRule
cmds.addCommand(cmd);
}
+ /**
+ * This method determines whether to use network-wide SNAT or NIC aware
SNAT
+ * @param networkId
+ * @param destinationIp
+ * @return
+ */
+ private boolean requiresReturnPathSnat(final long networkId, final String
destinationIp) {
+ if (!VirtualNetworkApplianceManager.NicSnatEnabled.value()) {
+ return false;
+ }
+
+ final NicVO destinationNic =
_nicDao.findByIp4AddressAndNetworkId(destinationIp, networkId);
+ if (destinationNic == null) {
+ logger.debug("Unable to find destination NIC for ip [{}] in
network [{}], assuming default NIC.", destinationIp, networkId);
+ return false;
+ }
+ return !destinationNic.isDefaultNic();
Review Comment:
good catch. I will re-apply the static NAT and port forwarding rules after
the default NIC is updated
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]