[ https://issues.apache.org/jira/browse/CLOUDSTACK-10346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16442943#comment-16442943 ]
ASF GitHub Bot commented on CLOUDSTACK-10346: --------------------------------------------- rafaelweingartner commented on issue #2514: [CLOUDSTACK-10346] Problem with NAT configuration and VMs not accessing each other via public IPs URL: https://github.com/apache/cloudstack/pull/2514#issuecomment-382473012 No success :( Here goes my iptables (with PR2579): ``` # Generated by iptables-save v1.4.14 on Wed Apr 18 17:44:29 2018 *nat :PREROUTING ACCEPT [3:180] :INPUT ACCEPT [0:0] :OUTPUT ACCEPT [6:456] :POSTROUTING ACCEPT [0:0] -A PREROUTING -d 10.0.2.102/32 -i eth1 -p tcp -m tcp --dport 22 -j DNAT --to-destination 172.16.0.214:22 -A PREROUTING -d 10.0.2.103/32 -i eth1 -p tcp -m tcp --dport 22 -j DNAT --to-destination 172.16.0.168:22 -A OUTPUT -d 10.0.2.102/32 -p tcp -m tcp --dport 22 -j DNAT --to-destination 172.16.0.214:22 -A OUTPUT -d 10.0.2.103/32 -p tcp -m tcp --dport 22 -j DNAT --to-destination 172.16.0.168:22 -A POSTROUTING -s 172.16.0.0/24 -o eth2 -j SNAT --to-source 172.16.0.1 -A POSTROUTING -o eth1 -j SNAT --to-source 10.0.2.130 -A POSTROUTING -o eth1 -j SNAT --to-source 10.0.2.102 -A POSTROUTING -d 10.0.2.102/32 -p tcp -m tcp --dport 22 -j SNAT --to-source 172.16.0.214:22 -A POSTROUTING -d 10.0.2.103/32 -p tcp -m tcp --dport 22 -j SNAT --to-source 172.16.0.168:22 COMMIT # Completed on Wed Apr 18 17:44:29 2018 # Generated by iptables-save v1.4.14 on Wed Apr 18 17:44:29 2018 *mangle :PREROUTING ACCEPT [215:13820] :INPUT ACCEPT [195:11692] :FORWARD ACCEPT [23:2308] :OUTPUT ACCEPT [166:12048] :POSTROUTING ACCEPT [189:14356] :ACL_OUTBOUND_eth2 - [0:0] :VPN_STATS_eth1 - [0:0] -A PREROUTING -i eth2 -m state --state RELATED,ESTABLISHED -j CONNMARK --restore-mark --nfmask 0xffffffff --ctmask 0xffffffff -A PREROUTING -s 172.16.0.0/24 ! -d 172.16.0.1/32 -i eth2 -m state --state NEW -j ACL_OUTBOUND_eth2 -A FORWARD -j VPN_STATS_eth1 -A POSTROUTING -p udp -m udp --dport 68 -j CHECKSUM --checksum-fill -A ACL_OUTBOUND_eth2 -d 224.0.0.18/32 -j ACCEPT -A ACL_OUTBOUND_eth2 -j ACCEPT -A ACL_OUTBOUND_eth2 -d 225.0.0.50/32 -j ACCEPT -A VPN_STATS_eth1 -o eth1 -m mark --mark 0x525 -A VPN_STATS_eth1 -i eth1 -m mark --mark 0x524 COMMIT # Completed on Wed Apr 18 17:44:29 2018 # Generated by iptables-save v1.4.14 on Wed Apr 18 17:44:29 2018 *filter :INPUT DROP [3:180] :FORWARD DROP [0:0] :OUTPUT ACCEPT [166:12048] :ACL_INBOUND_eth2 - [0:0] :FW_EGRESS_RULES - [0:0] :NETWORK_STATS - [0:0] :NETWORK_STATS_eth1 - [0:0] -A INPUT -d 172.16.0.1/32 -i eth2 -p tcp -m tcp --dport 443 -m state --state NEW -j ACCEPT -A INPUT -d 172.16.0.1/32 -i eth2 -p tcp -m tcp --dport 80 -m state --state NEW -j ACCEPT -A INPUT -d 172.16.0.1/32 -i eth2 -p tcp -m tcp --dport 53 -j ACCEPT -A INPUT -d 172.16.0.1/32 -i eth2 -p udp -m udp --dport 53 -j ACCEPT -A INPUT -j NETWORK_STATS -A INPUT -d 224.0.0.18/32 -j ACCEPT -A INPUT -d 225.0.0.50/32 -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -i eth0 -p tcp -m tcp --dport 3922 -m state --state NEW,ESTABLISHED -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -i eth2 -p udp -m udp --dport 67 -j ACCEPT -A INPUT -s 172.16.0.0/24 -i eth2 -p udp -m udp --dport 53 -j ACCEPT -A INPUT -s 172.16.0.0/24 -i eth2 -p tcp -m tcp --dport 53 -j ACCEPT -A INPUT -i eth2 -p tcp -m tcp --dport 80 -m state --state NEW -j ACCEPT -A INPUT -i eth2 -p tcp -m tcp --dport 8080 -m state --state NEW -j ACCEPT -A FORWARD -j NETWORK_STATS_eth1 -A FORWARD -j NETWORK_STATS -A FORWARD -s 172.16.0.0/16 ! -d 172.16.0.0/16 -j ACCEPT -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT -A FORWARD -d 172.16.0.0/24 -o eth2 -j ACL_INBOUND_eth2 -A OUTPUT -j NETWORK_STATS -A ACL_INBOUND_eth2 -d 225.0.0.50/32 -j ACCEPT -A ACL_INBOUND_eth2 -d 224.0.0.18/32 -j ACCEPT -A ACL_INBOUND_eth2 -j ACCEPT -A ACL_INBOUND_eth2 -j DROP -A NETWORK_STATS -i eth0 -o eth2 -p tcp -A NETWORK_STATS -i eth2 -o eth0 -p tcp -A NETWORK_STATS ! -i eth0 -o eth2 -p tcp -A NETWORK_STATS -i eth2 ! -o eth0 -p tcp -A NETWORK_STATS_eth1 -s 172.16.0.0/24 -o eth1 -A NETWORK_STATS_eth1 -d 172.16.0.0/24 -i eth1 COMMIT # Completed on Wed Apr 18 17:44:29 2018 ``` ---------------------------------------------------------------- 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: us...@infra.apache.org > Problem with NAT configuration and VMs not accessing each other via public IPs > ------------------------------------------------------------------------------ > > Key: CLOUDSTACK-10346 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10346 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Reporter: Rafael Weingärtner > Assignee: Rafael Weingärtner > Priority: Major > > When users create a VPC, and configure a NAT from a public IP to application > in a VM. This VM(applications) are not accessible via public IP for other VMs > in the same VPC. > > The problem is in the NAT table. If you take a closer look at rules, you will > see something like: > {code:java} > -A PREROUTING -d publicIP/32 -i eth1 -p tcp -m tcp --dport 80 -j DNAT > --to-destination internalIp:80 > {code} > The problem is that according to this rule only packets coming via > eth1(public interface), will be “redirected” to the internal IP. We need an > extra entry to each one of the NAT configurations. For the presented rule, we > would need something like: > {code:java} > -A PREROUTING -d publicIP/32 -i eth2 -p tcp -m tcp --dport 80 -j DNAT > --to-destination internalIp:80 > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)