weizhouapache commented on code in PR #13200:
URL: https://github.com/apache/cloudstack/pull/13200#discussion_r3273342979


##########
systemvm/debian/opt/cloud/bin/configure.py:
##########
@@ -1567,6 +1567,13 @@ def processStaticNatRule(self, rule):
         self.fw.append(["nat", "front", "-A POSTROUTING -s %s -d %s -j SNAT -o 
%s --to-source %s" %
                         (self.getNetworkByIp(rule['internal_ip']), 
rule["internal_ip"], self.getDeviceByIp(rule["internal_ip"]), 
self.getGuestIpByIp(rule["internal_ip"]))])
 
+        internal_device = self.getDeviceByIp(rule["internal_ip"])
+        internal_vr_ip = self.getGuestIpByIp(rule["internal_ip"])
+        if internal_device and internal_vr_ip and internal_device != device:
+            self.fw.append(["nat", "front",
+                            "-A POSTROUTING -o %s -d %s/32 -j SNAT --to-source 
%s" %
+                            (internal_device, rule["internal_ip"], 
internal_vr_ip)])

Review Comment:
   1. this should apply to additional nics of guest VMs only. since there is no 
issue with first NIC of guest VMs, it is not needed.
   2. it would be better to provide an option for end users.



-- 
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]

Reply via email to