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 22CB0200C88 for ; Fri, 2 Jun 2017 15:05:12 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 21C58160BD2; Fri, 2 Jun 2017 13:05:12 +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 42451160BD1 for ; Fri, 2 Jun 2017 15:05:11 +0200 (CEST) Received: (qmail 22529 invoked by uid 500); 2 Jun 2017 13:05:10 -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 22520 invoked by uid 500); 2 Jun 2017 13:05:09 -0000 Delivered-To: apmail-incubator-cloudstack-issues@incubator.apache.org Received: (qmail 22517 invoked by uid 99); 2 Jun 2017 13:05:09 -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; Fri, 02 Jun 2017 13:05:09 +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 739D0C043B for ; Fri, 2 Jun 2017 13:05:08 +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 FdpA_v5HwBsp for ; Fri, 2 Jun 2017 13:05:06 +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 EE6E75FE02 for ; Fri, 2 Jun 2017 13:05:05 +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 D28E2E0D54 for ; Fri, 2 Jun 2017 13:05:04 +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 4409321B5C for ; Fri, 2 Jun 2017 13:05:04 +0000 (UTC) Date: Fri, 2 Jun 2017 13:05:04 +0000 (UTC) From: "Nicolas SCHWARTZ (JIRA)" To: cloudstack-issues@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CLOUDSTACK-8699) Extra acquired public ip is assigned to wrong eth device MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 02 Jun 2017 13:05:12 -0000 [ https://issues.apache.org/jira/browse/CLOUDSTACK-8699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16033198#comment-16033198 ] Nicolas SCHWARTZ edited comment on CLOUDSTACK-8699 at 6/2/17 1:04 PM: ---------------------------------------------------------------------- The IP is always assigned to the last ethX device The following file configures the ip addresses ips.json { "eth0": [ { "add": true, "broadcast": "169.254.255.255", "cidr": "169.254.2.168/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.168", "size": "16", "source_nat": false } ], "eth1": [ { "add": true, "broadcast": "10.1.50.255", "cidr": "10.1.50.67/24", "device": "eth1", "first_i_p": false, "gateway": "10.1.50.1", "netmask": "255.255.255.0", "network": "10.1.50.0/24", "new_nic": false, "nic_dev_id": 1, "nw_type": "public", "one_to_one_nat": false, "public_ip": "10.1.50.67", "size": "24", "source_nat": true, "vif_mac_address": "06:ff:a8:00:01:c1" } ], "eth2": [ { "add": true, "broadcast": "192.168.0.3", "cidr": "192.168.0.1/30", "device": "eth2", "gateway": "192.168.0.1", "netmask": "255.255.255.252", "network": "192.168.0.0/30", "nic_dev_id": "2", "nw_type": "guest", "one_to_one_nat": false, "public_ip": "192.168.0.1", "size": "30", "source_nat": false }, { "add": false, "broadcast": "10.1.50.255", "cidr": "10.1.50.68/24", "device": "eth2", "first_i_p": false, "gateway": "10.1.50.1", "netmask": "255.255.255.0", "network": "10.1.50.0/24", "new_nic": false, "nic_dev_id": 2, "nw_type": "public", "one_to_one_nat": true, "public_ip": "10.1.50.68", "size": "24", "source_nat": false, "vif_mac_address": "06:ff:a8:00:01:c1" }, { "add": false, "broadcast": "10.1.50.255", "cidr": "10.1.50.66/24", "device": "eth2", "first_i_p": false, "gateway": "10.1.50.1", "netmask": "255.255.255.0", "network": "10.1.50.0/24", "new_nic": false, "nic_dev_id": 2, "nw_type": "public", "one_to_one_nat": true, "public_ip": "10.1.50.66", "size": "24", "source_nat": false, "vif_mac_address": "06:ff:a8:00:01:c1" } ], "id": "ips" And as you can see the mac address is correctly attributed for eth1 but eth2 is wrong for the two publics IPs. If I have correctly understood CloudStack architecture GSon is generated by the manager running in the tomcat server. So virtual scripts for the VPC are ok. was (Author: aurryon): The IP is always assigned to the last ethX device > Extra acquired public ip is assigned to wrong eth device > -------------------------------------------------------- > > Key: CLOUDSTACK-8699 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8699 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the default.) > Components: Virtual Router > Affects Versions: 4.4.4 > Environment: KVM on CentOS > Reporter: Remi Bergsma > > When the public network of a zone is untagged, an extra public ip address is bound to the wrong interface (eth2 instead of eth1). > Example: > root@r-44137-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:01:eb brd ff:ff:ff:ff:ff:ff > inet 169.254.1.235/16 brd 169.254.255.255 scope global eth0 > 3: eth1: mtu 1500 qdisc pfifo_fast state UP qlen 1000 > link/ether 06:46:32:00:00:8d brd ff:ff:ff:ff:ff:ff > inet xx.22.37.143/25 brd 85.222.237.255 scope global eth1 > 4: eth2: mtu 1500 qdisc pfifo_fast state UP qlen 1000 > link/ether 02:00:51:27:00:02 brd ff:ff:ff:ff:ff:ff > inet 10.0.0.1/24 brd 10.0.0.255 scope global eth2 > inet xx.22.37.145/25 brd 85.222.237.255 scope global eth2 > Obviously, this does not work. > # MGT server > 2015-07-31 13:08:12,330 DEBUG [agent.manager.ClusteredAgentAttache] (API-Job-Executor-98:ctx-cbf1e352 job-799791 ctx-58cb236f) Seq 437-2425751349292433542: Forwarding Seq 437-2425751349292433542: { Cmd , MgmtId: 345052433506, via: 437(mccxpod01-hv03.mccxpod01.mccx-shared-2.mccx.mcinfra.net), Ver: v1, Flags: 100001, [{"com.cloud.agent.api.routing.SetPortForwardingRulesVpcCommand":{"rules":[{"dstIp":"10.0.0.61","dstPortRange":[22,22],"id":54859,"srcIp":"xx.22.37.145","protocol":"tcp","srcPortRange":[22,22],"revoked":false,"alreadyAdded":false,"purpose":"PortForwarding","defaultEgressPolicy":false}],"accessDetails":{"zone.network.type":"Advanced","router.name":"r-44137-VM","router.ip":"169.254.1.235","router.guest.ip":"10.0.0.1"},"wait":0}}] } to 345052433504 > 2015-07-31 13:08:12,457 DEBUG [agent.transport.Request] (AgentManager-Handler-58:null) Seq 437-2425751349292433542: Processing: { Ans: , MgmtId: 345052433506, via: 437, Ver: v1, Flags: 0, [{"com.cloud.agent.api.Answer":{"result":true,"details":"","wait":0}}] } > 2015-07-31 13:08:12,457 DEBUG [agent.transport.Request] (API-Job-Executor-98:ctx-cbf1e352 job-799791 ctx-58cb236f) Seq 437-2425751349292433542: Received: { Ans: , MgmtId: 345052433506, via: 437, Ver: v1, Flags: 0, { Answer } } > # AGENT > 2015-07-31 13:08:12,203 DEBUG [cloud.agent.Agent] (agentRequest-Handler-4:null) Request:Seq 437-2425751349292433541: { Cmd , MgmtId: 345052433506, via: 437, Ver: v1, Flags: 100001, [{"com.cloud.agent.api.rout > ing.IpAssocVpcCommand":{"ipAddresses":[{"accountId":625,"publicIp":"xx.22.37.145","sourceNat":false,"add":true,"oneToOneNat":false,"firstIP":false,"broadcastUri":"vlan://untagged","vlanGateway":"xx.22.37.1 > 29","vlanNetmask":"255.255.255.128","vifMacAddress":"06:46:32:00:00:8d","networkRate":-1,"trafficType":"Public","networkName":"pubbr0","newNic":false}],"accessDetails":{"router.guest.ip":"xx.22.37.143","zone > .network.type":"Advanced","router.ip":"169.254.1.235","router.name":"r-44137-VM"},"wait":0}}] } > 2015-07-31 13:08:12,204 DEBUG [cloud.agent.Agent] (agentRequest-Handler-4:null) Processing command: com.cloud.agent.api.routing.IpAssocVpcCommand > 2015-07-31 13:08:12,206 DEBUG [kvm.resource.LibvirtComputingResource] (agentRequest-Handler-4:null) Executing: /usr/share/cloudstack-common/scripts/network/domr/router_proxy.sh vpc_ipassoc.sh 169.254.1.235 -A > -l xx.22.37.145 -c eth2 -g xx.22.37.129 -m 25 -n xx.22.37.128 > As you see, the vpc_assoc.sh script is instructed to use the wrong eth interface. > See also: > core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java > api/src/com/cloud/agent/api/to/IpAddressTO.java -- This message was sent by Atlassian JIRA (v6.3.15#6346)