<div dir="ltr">Hello,<div>I run lxc container on centos and want to my container to start with a static IP address.  </div><div><br></div><div>After some investigation, I figured out that the dnsmasq is started by libvirtd to provide DNS and DHCP service to the container. However, I cannot figure out how to reserve ip address for a specific host in the dnsmasq config file. <br clear="all">
<div><br></div><div>Meanwhile, in the ps out, it looks like no config file is given when start the dnsmasq daemon, which doesn't sound right.</div><div><br></div><div>nobody   12531     1  0 Feb12 ?        00:00:01 /usr/sbin/dnsmasq --strict-order --local=// --domain-needed --pid-file=/var/run/libvirt/network/default.pid --conf-file= --except-interface lo --bind-interfaces --listen-address 192.168.122.1 --dhcp-range 192.168.122.2,192.168.122.254 --dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases --dhcp-lease-max=253 --dhcp-no-override --dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile --addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts<br>
</div><div><br></div><div>As a workaround, I configured a static ip address in the container like how we configure an ip address to a standard Linux box. However, I want to know how to config dnsmasq to give static ip address to a specific container because I may run lots of containers. Appreciate any response and idea. Thanks!</div>
<div><br></div>-- <br>Thanks<br>-Mingjiang
</div></div>