Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions systemvm/debian/etc/dnsmasq.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -636,3 +636,4 @@ log-facility=/var/log/dnsmasq.log
conf-dir=/etc/dnsmasq.d

dhcp-optsfile=/etc/dhcpopts.txt
localise-queries
12 changes: 9 additions & 3 deletions systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ def configure_server(self):
if gn.get_dns() and device:
sline = "dhcp-option=tag:interface-%s-%s,6" % (device, idx)
dns_list = [x for x in gn.get_dns() if x]
if self.config.is_dhcp() and not self.config.use_extdns():
guest_ip = self.config.address().get_guest_ip()
if guest_ip and guest_ip in dns_list and ip not in dns_list:
## Replace the default guest IP in VR with the ip in additional IP ranges, if shared network has multiple IP ranges.
dns_list.remove(guest_ip)
dns_list.insert(0, ip)
line = "dhcp-option=tag:interface-%s-%s,6,%s" % (device, idx, ','.join(dns_list))
self.conf.search(sline, line)
if gateway != '0.0.0.0':
Expand All @@ -129,8 +135,10 @@ def configure_server(self):
else:
listen_address.append(ip)
# Add localized "data-server" records in /etc/hosts for VPC routers
if self.config.is_vpc():
if self.config.is_vpc() or self.config.is_router():
self.add_host(gateway, "%s data-server" % CsHelper.get_hostname())
elif self.config.is_dhcp():
self.add_host(ip, "%s data-server" % CsHelper.get_hostname())
idx += 1

# Listen Address
Expand Down Expand Up @@ -166,8 +174,6 @@ def preseed(self):
self.add_host("::1", "localhost ip6-localhost ip6-loopback")
self.add_host("ff02::1", "ip6-allnodes")
self.add_host("ff02::2", "ip6-allrouters")
if self.config.is_router() or self.config.is_dhcp():
self.add_host(self.config.address().get_guest_ip(), "%s data-server" % CsHelper.get_hostname())

def write_hosts(self):
file = CsFile("/etc/hosts")
Expand Down