Disabling DHCP on a LibVirt setup
So you have this libvirt setup and you want to have a dhcp server on the virtual machines you are playing with , or you want to have all static IP's.
Libvirt uses dnsmasq to provide dhcp services etc and when you generate a config from the gui it will look like
<network> <name>piponet</name> <uuid>e87d3bf1-a2e7-96ca-e131-7ae51ac033f9</uuid> <bridge name='virbr2' stp='on' delay='0' /> <ip address='192.168.100.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.100.128' end='192.168.100.254' /> </dhcp> </ip> </network>
If you fully remove the dhcp section, then restart libvirt you'll notice dnsmasq running with no dhcpd on that subnet so you'll have full control again :)
<network> <name>piponet</name> <uuid>e87d3bf1-a2e7-96ca-e131-7ae51ac033f9</uuid> <bridge name='virbr2' stp='on' delay='0' /> <ip address='192.168.100.1' netmask='255.255.255.0'> </ip> </network>
Comments
#1 Serge van Ginderachter : Or you could install the latest virt-manager 0.8.1
.. which support disabling dhcp :-)