When building a virtualization lab system, I’ve found that I want static IPs assigned to my guests. You could just assign static IPs in the guest OS, but then you should document what IPs are in use for what hosts. It would be easier to just assign static IP entries in the DHCP server. There doesn’t seem to be a straight-forward way to get this done.
What I’ve found works is to destroy the network, edit it directly, and then restart it.
[root@m77413 libvirt]# virsh -c qemu:///system net-destroy default Network default destroyed [root@m77413 libvirt]# virsh -c qemu:///system net-edit default Network default XML configuration edited. [root@m77413 libvirt]# virsh -c qemu:///system net-start default Network default started
The xml file entries should look like:
<ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.122.2' end='192.168.122.254' />
<host mac='52:54:00:10:6e:17' name='cent-install.test' ip='192.168.122.2' />
<host mac='52:54:00:ab:10:2a' name='cent-netserver.test' ip='192.168.122.3' />
<host mac='52:54:00:df:47:95' name='install.test' ip='192.168.122.10' />
</dhcp>
</ip>