Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion systemvm/debian/opt/cloud/bin/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ def forward_vr(self, rule):
)
fw4 = "-j SNAT --to-source %s -A POSTROUTING -s %s -d %s/32 -o %s -p %s -m %s --dport %s" % \
(
self.getGuestIp(),
self.getGuestIpByIp(rule['internal_ip']),
self.getNetworkByIp(rule['internal_ip']),
rule['internal_ip'],
internal_fwinterface,
Expand Down Expand Up @@ -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)])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  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.



class IpTablesExecutor:

Expand Down
Loading