mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
router: Use source IP from subnet for snat (#5376)
When snat is configured on a vm in a subnet then the source ip should be taken from the same subnet rather than from random other subnet. Co-authored-by: Rakesh Venkatesh <rakeshv@apache.org>
This commit is contained in:
parent
989a46850e
commit
70f2420e54
@ -1008,7 +1008,7 @@ class CsForwardingRules(CsDataBag):
|
||||
|
||||
# Configure the hairpin snat
|
||||
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.getGuestIp())])
|
||||
(self.getNetworkByIp(rule['internal_ip']), rule["internal_ip"], self.getDeviceByIp(rule["internal_ip"]), self.getGuestIpByIp(rule["internal_ip"]))])
|
||||
|
||||
|
||||
class IpTablesExecutor:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user