Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1FA84200CBC for ; Tue, 20 Jun 2017 12:52:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1DF67160BE1; Tue, 20 Jun 2017 10:52:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 15923160BD3 for ; Tue, 20 Jun 2017 12:52:05 +0200 (CEST) Received: (qmail 59126 invoked by uid 500); 20 Jun 2017 10:52:05 -0000 Mailing-List: contact issues-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list issues@cloudstack.apache.org Received: (qmail 59117 invoked by uid 500); 20 Jun 2017 10:52:05 -0000 Delivered-To: apmail-incubator-cloudstack-issues@incubator.apache.org Received: (qmail 59114 invoked by uid 99); 20 Jun 2017 10:52:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Jun 2017 10:52:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id D477EC0620 for ; Tue, 20 Jun 2017 10:52:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id DzSZJpmnmosK for ; Tue, 20 Jun 2017 10:52:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 857825F6CD for ; Tue, 20 Jun 2017 10:52:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id B9889E0BC8 for ; Tue, 20 Jun 2017 10:52:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1194824006 for ; Tue, 20 Jun 2017 10:52:00 +0000 (UTC) Date: Tue, 20 Jun 2017 10:52:00 +0000 (UTC) From: "DeepthiMachiraju (JIRA)" To: cloudstack-issues@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CLOUDSTACK-9969) Public IP acquired from additional public ranges which is static nat enabled is set to true post releasing the IP in VPC VR. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 20 Jun 2017 10:52:07 -0000 DeepthiMachiraju created CLOUDSTACK-9969: -------------------------------------------- Summary: Public IP acquired from additional public ranges which is static nat enabled is set to true post releasing the IP in VPC VR. Key: CLOUDSTACK-9969 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9969 Project: CloudStack Issue Type: Bug Security Level: Public (Anyone can view this level - this is the default.) Components: Virtual Router, VPC Affects Versions: 4.10.0.0 Reporter: DeepthiMachiraju Fix For: 4.10.0.0 Attachments: cloud.log, management-server.log - Create VPC and create multiple tiers within VPC. - Acquire IP from additional Public Range and ENable static nat on the IP. ============== rules created after the above step ============================= - Here eth4 : 10.x.203 , 10.x.204 are the acquired ip - 10.147.52.203 is static nat enabled. root@r-199-VM:~# ip a 1: lo: mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo 2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 0e:00:a9:fe:02:5f brd ff:ff:ff:ff:ff:ff inet 169.254.2.95/16 brd 169.254.255.255 scope global eth0 3: eth1: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 06:3b:84:00:00:0e brd ff:ff:ff:ff:ff:ff inet 10.147.30.113/24 brd 10.147.30.255 scope global eth1 4: eth2: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 02:00:06:b4:00:02 brd ff:ff:ff:ff:ff:ff inet 192.168.2.1/24 brd 192.168.2.255 scope global eth2 5: eth3: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 02:00:05:12:00:02 brd ff:ff:ff:ff:ff:ff inet 192.168.1.1/24 brd 192.168.1.255 scope global eth3 6: eth4: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 06:56:62:00:00:1f brd ff:ff:ff:ff:ff:ff inet 10.147.52.203/24 brd 10.147.52.255 scope global eth4 inet 10.147.52.204/24 brd 10.147.52.255 scope global secondary eth4 root@r-199-VM:/etc/cloudstack# cat forwardingrules.json { "10.147.52.203": [ { "internal_ip": "192.168.1.90", "public_ip": "10.147.52.203", "type": "staticnat" } ], "id": "forwardingrules" ===================== ips.json ================ root@r-199-VM:/etc/cloudstack# cat ips.json { "eth0": [ { "add": true, "broadcast": "169.254.255.255", "cidr": "169.254.2.95/16", "device": "eth0", "gateway": "None", "netmask": "255.255.0.0", "network": "169.254.0.0/16", "nic_dev_id": "0", "nw_type": "control", "one_to_one_nat": false, "public_ip": "169.254.2.95", "size": "16", "source_nat": false } ], "eth1": [ { "add": true, "broadcast": "10.147.30.255", "cidr": "10.147.30.113/24", "device": "eth1", "first_i_p": true, "gateway": "10.147.30.1", "netmask": "255.255.255.0", "network": "10.147.30.0/24", "new_nic": false, "nic_dev_id": 1, "nw_type": "public", "one_to_one_nat": false, "public_ip": "10.147.30.113", "size": "24", "source_nat": true, "vif_mac_address": "06:3b:84:00:00:0e" } ], "eth2": [ { "add": true, "broadcast": "192.168.2.255", "cidr": "192.168.2.1/24", "device": "eth2", "gateway": "192.168.2.1", "netmask": "255.255.255.0", "network": "192.168.2.0/24", "nic_dev_id": "2", "nw_type": "guest", "one_to_one_nat": false, "public_ip": "192.168.2.1", "size": "24", "source_nat": false } ], "eth3": [ { "add": true, "broadcast": "192.168.1.255", "cidr": "192.168.1.1/24", "device": "eth3", "gateway": "192.168.1.1", "netmask": "255.255.255.0", "network": "192.168.1.0/24", "nic_dev_id": "3", "nw_type": "guest", "one_to_one_nat": false, "public_ip": "192.168.1.1", "size": "24", "source_nat": false } ], "eth4": [ { "add": true, "broadcast": "10.147.52.255", "cidr": "10.147.52.204/24", "device": "eth4", "first_i_p": true, "gateway": "10.147.52.1", "netmask": "255.255.255.0", "network": "10.147.52.0/24", "new_nic": false, "nic_dev_id": 4, "nw_type": "public", "one_to_one_nat": false, "public_ip": "10.147.52.204", "size": "24", "source_nat": true, "vif_mac_address": "06:56:62:00:00:1f" }, { "add": true, "broadcast": "10.147.52.255", "cidr": "10.147.52.203/24", "device": "eth4", "first_i_p": false, "gateway": "10.147.52.1", "netmask": "255.255.255.0", "network": "10.147.52.0/24", "new_nic": false, "nic_dev_id": 4, "nw_type": "public", "one_to_one_nat": true, "public_ip": "10.147.52.203", "size": "24", "source_nat": false, "vif_mac_address": "06:56:62:00:00:1f" } ], "id": "ips" ============================================== - Both the acquired IP's are released from the UI. ============ logs post releasing ========================= - eth4 10.147.52.203 is still set to true in ips.json file. - IPtables are cleaned up. root@r-199-VM:/etc/cloudstack# ip a 1: lo: mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo 2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 0e:00:a9:fe:02:5f brd ff:ff:ff:ff:ff:ff inet 169.254.2.95/16 brd 169.254.255.255 scope global eth0 3: eth1: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 06:3b:84:00:00:0e brd ff:ff:ff:ff:ff:ff inet 10.147.30.113/24 brd 10.147.30.255 scope global eth1 4: eth2: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 02:00:06:b4:00:02 brd ff:ff:ff:ff:ff:ff inet 192.168.2.1/24 brd 192.168.2.255 scope global eth2 5: eth3: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 02:00:05:12:00:02 brd ff:ff:ff:ff:ff:ff inet 192.168.1.1/24 brd 192.168.1.255 scope global eth3 root@r-199-VM:/etc/cloudstack# cat ips.json { "eth0": [ { "add": true, "broadcast": "169.254.255.255", "cidr": "169.254.2.95/16", "device": "eth0", "gateway": "None", "netmask": "255.255.0.0", "network": "169.254.0.0/16", "nic_dev_id": "0", "nw_type": "control", "one_to_one_nat": false, "public_ip": "169.254.2.95", "size": "16", "source_nat": false } ], "eth1": [ { "add": true, "broadcast": "10.147.30.255", "cidr": "10.147.30.113/24", "device": "eth1", "first_i_p": true, "gateway": "10.147.30.1", "netmask": "255.255.255.0", "network": "10.147.30.0/24", "new_nic": false, "nic_dev_id": 1, "nw_type": "public", "one_to_one_nat": false, "public_ip": "10.147.30.113", "size": "24", "source_nat": true, "vif_mac_address": "06:3b:84:00:00:0e" } ], "eth2": [ { "add": true, "broadcast": "192.168.2.255", "cidr": "192.168.2.1/24", "device": "eth2", "gateway": "192.168.2.1", "netmask": "255.255.255.0", "network": "192.168.2.0/24", "nic_dev_id": "2", "nw_type": "guest", "one_to_one_nat": false, "public_ip": "192.168.2.1", "size": "24", "source_nat": false } ], "eth3": [ { "add": true, "broadcast": "192.168.1.255", "cidr": "192.168.1.1/24", "device": "eth3", "gateway": "192.168.1.1", "netmask": "255.255.255.0", "network": "192.168.1.0/24", "nic_dev_id": "3", "nw_type": "guest", "one_to_one_nat": false, "public_ip": "192.168.1.1", "size": "24", "source_nat": false } ], "eth4": [ { "add": true, "broadcast": "10.147.52.255", "cidr": "10.147.52.203/24", "device": "eth4", "first_i_p": true, "gateway": "10.147.52.1", "netmask": "255.255.255.0", "network": "10.147.52.0/24", "new_nic": false, "nic_dev_id": 4, "nw_type": "public", "one_to_one_nat": true, "public_ip": "10.147.52.203", "size": "24", "source_nat": true, "vif_mac_address": "06:56:62:00:00:1f" }, { "add": false, "broadcast": "10.147.52.255", "cidr": "10.147.52.204/24", "device": "eth4", "first_i_p": true, "gateway": "10.147.52.1", "netmask": "255.255.255.0", "network": "10.147.52.0/24", "new_nic": false, "nic_dev_id": 4, "nw_type": "public", "one_to_one_nat": false, "public_ip": "10.147.52.204", "size": "24", "source_nat": true, "vif_mac_address": "06:56:62:00:00:1f" } ], "id": "ips" ======================================================== - BUt when a new IP is acquired from the same subnet and a rule is configured for that IP , the previous [203] IP which was deleted but set to true in IPs.json file is now observed in interfaces and iptables . root@r-199-VM:~# ip a 1: lo: mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo 2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 0e:00:a9:fe:02:11 brd ff:ff:ff:ff:ff:ff inet 169.254.2.17/16 brd 169.254.255.255 scope global eth0 3: eth1: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 06:3b:84:00:00:0e brd ff:ff:ff:ff:ff:ff inet 10.147.30.113/24 brd 10.147.30.255 scope global eth1 4: eth2: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 02:00:06:b4:00:02 brd ff:ff:ff:ff:ff:ff inet 192.168.2.1/24 brd 192.168.2.255 scope global eth2 5: eth3: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 02:00:05:12:00:02 brd ff:ff:ff:ff:ff:ff inet 192.168.1.1/24 brd 192.168.1.255 scope global eth3 6: eth4: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 06:f3:ba:00:00:1e brd ff:ff:ff:ff:ff:ff inet 10.147.52.202/24 brd 10.147.52.255 scope global eth4 inet 10.147.52.203/24 brd 10.147.52.255 scope global secondary eth4 root@r-199-VM:/etc/cloudstack# cat forwardingrules.json { "10.147.52.202": [ { "internal_ip": "192.168.2.233", "internal_ports": "22:22", "protocol": "tcp", "public_ip": "10.147.52.202", "public_ports": "22:22", "type": "forward" } ], "id": "forwardingrules" < old ip 10.X.203 in the iptables > root@r-199-VM:/etc/cloudstack# iptables -t nat -L Chain PREROUTING (policy ACCEPT) target prot opt source destination DNAT tcp -- anywhere 10.147.52.202 tcp dpt:ssh to:192.168.2.233:22 Chain INPUT (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination DNAT tcp -- anywhere 10.147.52.202 tcp dpt:ssh to:192.168.2.233:22 Chain POSTROUTING (policy ACCEPT) target prot opt source destination ACCEPT all -- anywhere anywhere mark match 0x525 SNAT all -- 192.168.1.0/24 anywhere to:192.168.1.1 SNAT all -- 192.168.2.0/24 anywhere to:192.168.2.1 SNAT all -- anywhere anywhere to:10.147.30.113 SNAT all -- anywhere anywhere to:10.147.52.202 SNAT all -- anywhere anywhere to:10.147.52.203 SNAT tcp -- anywhere 10.147.52.202 tcp dpt:ssh to:192.168.2.233:22 Attached cloud.log and Ms log -- This message was sent by Atlassian JIRA (v6.4.14#64029)