diff --git a/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java b/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java index 6cc0ace1e056..500e1dce6cb5 100644 --- a/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java +++ b/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java @@ -1251,8 +1251,11 @@ public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, Depl if (nic.getTrafficType() == TrafficType.Management) { String mgmt_cidr = configurationDao.getValue(Config.ManagementNetwork.key()); - if (NetUtils.isValidIp4Cidr(mgmt_cidr)) { + if (NetUtils.isValidCidrList(mgmt_cidr)) { + s_logger.debug("Management server cidr list is " + mgmt_cidr); buf.append(" mgmtcidr=").append(mgmt_cidr); + } else { + s_logger.error("Invalid management cidr list: " + mgmt_cidr); } buf.append(" localgw=").append(dest.getPod().getGateway()); } diff --git a/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java b/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java index f7c22c209852..3fb10b7a8c46 100644 --- a/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java +++ b/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java @@ -1125,8 +1125,11 @@ public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, Depl } if (nic.getTrafficType() == TrafficType.Management) { String mgmt_cidr = _configDao.getValue(Config.ManagementNetwork.key()); - if (NetUtils.isValidIp4Cidr(mgmt_cidr)) { + if (NetUtils.isValidCidrList(mgmt_cidr)) { + s_logger.debug("Management server cidr list is " + mgmt_cidr); buf.append(" mgmtcidr=").append(mgmt_cidr); + } else { + s_logger.error("Inavlid management server cidr list: " + mgmt_cidr); } buf.append(" localgw=").append(dest.getPod().getGateway()); buf.append(" private.network.device=").append("eth").append(deviceId); diff --git a/systemvm/debian/opt/cloud/bin/setup/common.sh b/systemvm/debian/opt/cloud/bin/setup/common.sh index 987f07d7659d..780cf54a947b 100755 --- a/systemvm/debian/opt/cloud/bin/setup/common.sh +++ b/systemvm/debian/opt/cloud/bin/setup/common.sh @@ -322,7 +322,12 @@ setup_common() { if [ -n "$MGMTNET" -a -n "$LOCAL_GW" ] then - ip route add $MGMTNET via $LOCAL_GW dev eth1 + log_it "Received mgmt cidr : $MGMTNET" + cidrs=(${MGMTNET//,/ }) + for cidr in ${cidrs[@]} + do + ip route add $cidr via $LOCAL_GW dev eth1 + done fi ip route delete default