ustcweizhou commented on issue #2680: Using Source NAT option on Private 
Gateway does not work
URL: https://github.com/apache/cloudstack/issues/2680#issuecomment-393178304
 
 
   @Slair1 Thanks for you reply on jira.
   You are correct. VPC connects the entire network in DC via private gateway, 
not entire internet. The routes (default and to static route) are good.
   
   Looking at the code, I think the iptables rules should be added by
   ```
           if self.get_type() == "public" and self.config.is_vpc() and method 
== "add":
               if self.address["source_nat"]:
                   vpccidr = cmdline.get_vpccidr()
                   self.fw.append(
                       ["filter", 3, "-A FORWARD -s %s ! -d %s -j ACCEPT" % 
(vpccidr, vpccidr)])
                   self.fw.append(
                       ["nat", "", "-A POSTROUTING -j SNAT -o %s --to-source 
%s" % (self.dev, self.address['public_ip'])])
   ```
   see line 584 to line 590 in
   
https://github.com/apache/cloudstack/blob/master/systemvm/debian/opt/cloud/bin/cs/CsAddress.py
   
   Could you post /etc/cloudstack/ips.json in the virtual router ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to