With below code, I can set the custom management network for guests, it works and sets vagrant management network ip addresses for the machines in defined network from DHCP pool. But I need to set specific ip adress for a specific machine, not from DHCP pool. Is there a way to set a static ip?
config.vm.provider "libvirt" do |v|
v.management_network_name = "my_network"
v.management_network_address = "10.11.12.0/24"
end
I have found a non-proper way by a host command which runs virsh. But it worked.
system("virsh net-update my-network add ip-dhcp-host \"<host mac='52:54:00:fb:95:91' ip='10.11.12.13' />\" --live --config")
config.vm.provider "libvirt" do |v|
v.management_network_name = "my_network"
v.management_network_address = "10.11.12.0/24"
v.management_network_mac = "52:54:00:fb:95:91"
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With