I am trying to add fixed address to specific virtual host, therefor I closed virtual machine and used sudo virsh net-edit somenet
. After adding line
<host mac='52:54:00:26:61:22' name='virt.example.com' ip='192.168.111.111' />
I saved and quit. Then I checked again with same command and previous state was restored, my changes were gone.
Same time, when I look into /etc/libvirt/qemu/networks/somenet.xml
, my changes are applied.
If I start my virtual machine again, it gets IP from DHCP pool (192.168.111.170
), but not the address I defined above.
When I restart libvirt-service after changes, situation seems same: in config file are my changes, with virsh
I see vanilla state and virtual machine gets wrong IP.
What is wrong here?
Edit. Adding full XML here. Here is conf I see below /etc
:
<network>
<name>somenet</name>
<uuid>80d85710-23bb-1ab6-79e6-cd65c6739714</uuid>
<bridge name='virbr1' stp='on' delay='0' />
<mac address='52:54:00:90:75:1A'/>
<domain name='example.com'/>
<ip address='192.168.111.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.111.100' end='192.168.111.254' />
<host mac='52:54:00:26:61:22' name='virt.example.com' ip='192.168.111.111' />
</dhcp>
</ip>
</network>
Here is conf I see with virsh
:
<network>
<name>somenet</name>
<uuid>80d85710-23bb-1ab6-79e6-cd65c6739714</uuid>
<bridge name='virbr1' stp='on' delay='0' />
<mac address='52:54:00:90:75:1A'/>
<ip address='192.168.111.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.111.128' end='192.168.111.254' />
</dhcp>
</ip>
</network>