From 0db9c980a678aa250d3b1a401c1b308c15bf5ed6 Mon Sep 17 00:00:00 2001 From: Daan Hoogland Date: Thu, 20 Apr 2017 09:36:17 +0200 Subject: [PATCH 1/2] ignore bogus default gateway when a shared network is secondary the default gateway gets overwritten by a bogus one dnsmasq does the right thing and replaces it with its own default which is not good for us so check for '0.0.0.0' --- systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py index 23b74995364..da9e6168ee0 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py @@ -89,9 +89,10 @@ class CsDhcp(CsDataBag): gateway = gn.get_gateway() else: gateway = i['gateway'] - sline = "dhcp-option=tag:interface-%s-%s,3," % (device, idx) - line = "dhcp-option=tag:interface-%s-%s,3,%s" % (device, idx, gateway) - self.conf.search(sline, line) + if gateway != '0.0.0.0': + sline = "dhcp-option=tag:interface-%s-%s,3," % (device, idx) + line = "dhcp-option=tag:interface-%s-%s,3,%s" % (device, idx, gateway) + self.conf.search(sline, line) # Netmask netmask = '' if self.config.is_vpc(): From 2e926d87e066011cd781d83946f8b3c44ae61b00 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Mon, 15 May 2017 08:20:41 +0200 Subject: [PATCH 2/2] Do not set gateway to 0.0.0.0 for windows clients --- .../com/cloud/network/router/CommandSetupHelper.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/server/src/com/cloud/network/router/CommandSetupHelper.java b/server/src/com/cloud/network/router/CommandSetupHelper.java index 7208b256813..460a9c80fb6 100644 --- a/server/src/com/cloud/network/router/CommandSetupHelper.java +++ b/server/src/com/cloud/network/router/CommandSetupHelper.java @@ -108,8 +108,6 @@ import com.cloud.offering.NetworkOffering; import com.cloud.offerings.NetworkOfferingVO; import com.cloud.offerings.dao.NetworkOfferingDao; import com.cloud.service.dao.ServiceOfferingDao; -import com.cloud.storage.GuestOSVO; -import com.cloud.storage.dao.GuestOSDao; import com.cloud.user.Account; import com.cloud.uservm.UserVm; import com.cloud.utils.Pair; @@ -174,8 +172,6 @@ public class CommandSetupHelper { private VlanDao _vlanDao; @Inject private IPAddressDao _ipAddressDao; - @Inject - private GuestOSDao _guestOSDao; @Inject private RouterControlHelper _routerControlHelper; @@ -221,12 +217,6 @@ public class CommandSetupHelper { _networkModel.getExecuteInSeqNtwkElmtCmd()); String gatewayIp = nic.getIPv4Gateway(); - if (!nic.isDefaultNic()) { - final GuestOSVO guestOS = _guestOSDao.findById(vm.getGuestOSId()); - if (guestOS == null || !guestOS.getDisplayName().toLowerCase().contains("windows")) { - gatewayIp = "0.0.0.0"; - } - } final DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId());