mirror of https://github.com/apache/cloudstack.git
bug 10748: fixed it when the VM acts as a dhcp server only
status 10748: resolved fixed
This commit is contained in:
parent
a671a78da4
commit
c460a1b80b
|
|
@ -270,19 +270,6 @@ setup_dnsmasq() {
|
|||
echo "dhcp-option=119,$DNS_SEARCH_ORDER" >> /etc/dnsmasq.conf
|
||||
fi
|
||||
|
||||
if [ "$USE_EXTERNAL_DNS" == "true" ]
|
||||
then
|
||||
sed -i -e "/^[#]*dhcp-option=6.*$/d" /etc/dnsmasq.conf
|
||||
if [ -n "$NS1" ]
|
||||
then
|
||||
if [ -n "$NS2" ]
|
||||
then
|
||||
echo "dhcp-option=6,$NS1,$NS2" >> /etc/dnsmasq.conf
|
||||
else
|
||||
echo "dhcp-option=6,$NS1" >> /etc/dnsmasq.conf
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
setup_sshd(){
|
||||
|
|
@ -310,6 +297,15 @@ setup_router() {
|
|||
fi
|
||||
|
||||
setup_dnsmasq
|
||||
|
||||
NS=$NS1
|
||||
[ -n "$NS2" ] && NS=$NS1,$NS2
|
||||
if [ "$USE_EXTERNAL_DNS" == "true" ]
|
||||
then
|
||||
sed -i -e "/^[#]*dhcp-option=6.*$/d" /etc/dnsmasq.conf
|
||||
echo "dhcp-option=6,$NS" >> /etc/dnsmasq.conf
|
||||
fi
|
||||
|
||||
setup_apache2 $ETH0_IP
|
||||
|
||||
sed -i /gateway/d /etc/hosts
|
||||
|
|
@ -335,14 +331,18 @@ setup_dhcpsrvr() {
|
|||
|
||||
NS=$NS1
|
||||
[ -n "$NS2" ] && NS=$NS1,$NS2
|
||||
|
||||
if [ "$DEFAULTROUTE" != "false" ]
|
||||
then
|
||||
sed -i -e "/^[#]*dhcp-option=option:router.*$/d" /etc/dnsmasq.conf
|
||||
echo "dhcp-option=option:router,$GW" >> /etc/dnsmasq.conf
|
||||
#for now set up ourself as the dns server as well
|
||||
sed -i -e "/^[#]*dhcp-option=6.*$/d" /etc/dnsmasq.conf
|
||||
echo "dhcp-option=6,$ETH0_IP,$NS" >> /etc/dnsmasq.conf
|
||||
if [ "$USE_EXTERNAL_DNS" == "true" ]
|
||||
then
|
||||
echo "dhcp-option=6,$NS" >> /etc/dnsmasq.conf
|
||||
else
|
||||
echo "dhcp-option=6,$ETH0_IP,$NS" >> /etc/dnsmasq.conf
|
||||
fi
|
||||
else
|
||||
sed -i -e "/^[#]*dhcp-option=option:router.*$/d" /etc/dnsmasq.conf
|
||||
echo "dhcp-option=option:router" >> /etc/dnsmasq.conf
|
||||
|
|
|
|||
|
|
@ -1018,7 +1018,6 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||
buf.append(" dnssearchorder=").append(domain_suffix);
|
||||
}
|
||||
|
||||
|
||||
if (!network.isDefault() && network.getGuestType() == GuestIpType.Direct) {
|
||||
buf.append(" defaultroute=false");
|
||||
|
||||
|
|
@ -1036,10 +1035,10 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||
if (defaultDns2 != null) {
|
||||
buf.append(" dns2=").append(defaultDns2);
|
||||
}
|
||||
|
||||
String use_external_dns = _configDao.getValue("use.external.dns");
|
||||
|
||||
String use_external_dns = _configDao.getValue(Config.UseExternalDnsServers.key());
|
||||
if (use_external_dns!=null && use_external_dns.equals("true")){
|
||||
buf.append(" useextdns=").append(use_external_dns);
|
||||
buf.append(" useextdns=true");
|
||||
}
|
||||
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue