9

I have set up a few soon-to-be production VMs running on QEMU-KVM on Ubuntu 10.04 LTS.

As for networking, I chose the "NAT" option in Virt-Manager and each VM now gets an IP address 192.168.122.x from QEMU's internal DHCP server.

I've restarted the VMs several times and the IP addresses are always the same. I've given each VM a network adapter with a unique MAC address.

So can I rely on that QEMU's internal DHCP server will give out the same IP addresses? Or is the safest option to set static IP addresses from within each VM?

1 Answer 1

9

Seems my question is answered in the libvirt manual. One needs to specifically ensure that the same IP is handed out via DHCP each time. Here's how this can be specified:

<network>
  …
  <ip address="192.0.2.1" netmask="255.255.255.0">
    <dhcp>
      <range start="192.0.2.128" end="192.0.2.254">
      <host mac="01:23:45:67:89:ab" name="foo.example.com" ip="192.0.2.64">
    </dhcp>
  </ip>
</network>

Alternatively, static IP is a viable option.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .