OpenStack: override DHCP information sent by DNSMASQ to a VM
One of the most annoying thing is when the resolv.conf
of your VM keeps changing because of the information sent by the DNSMASQ process. In this article, I assume that your setup has some conventions such as:
- One network per customer, with fixed_ips range with something like
10.100.$ID.0/24
- One ID (number) per tenant
First create a template file for your initial dhclient configuration file. Using a template file makes things easier to build base images.
$ sudo cp /etc/dhcp/dhclient.conf /etc/dhcp/dhclient.conf.template |
Then append the following lines in /etc/dhcp/dhclient.conf.template
:
supersede domain-name-servers 10.100.X.254;
supersede domain-name "template.your-super-cloud.domain";
The above example shows my fixed_ips range. You might have to edit it with your own range.
Eventually edit your /etc/rc.local
with the following:
#!/bin/sh -e |
Enjoy!
Comments