mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
Add missing sourcenat rule
This commit is contained in:
parent
6d12d94e0c
commit
f21b90a73e
@ -409,6 +409,11 @@ class CsIP:
|
||||
pwdsvc = CsPasswdSvc(self).setup()
|
||||
elif self.get_type() == "public":
|
||||
if self.address["source_nat"] == True:
|
||||
cmdline = CsDataBag("cmdline")
|
||||
dbag = cmdline.get_bag()
|
||||
# FIXME way to VPC specific
|
||||
vpccidr = dbag["config"]["vpccidr"]
|
||||
fw.append(["filter", "", "-A FORWARD -s %s ! -d %s -j ACCEPT" % (vpccidr, vpccidr)])
|
||||
fw.append(["nat","","-A POSTROUTING -j SNAT -o %s --to-source %s" % (self.dev, self.address['public_ip'])])
|
||||
route.flush()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user