harish.shastry@gmail.com
2016-Aug-02 13:00 UTC
[libvirt-users] Assigning static ip address in libvirt
Hello Is there way to assign static ip address to lxc and KVM guests with libvirt? I saw some snippets here https://libvirt.org/formatdomain.html#ipconfig but unable to get it to work. Regards Harish Regards Harish
Laine Stump
2016-Aug-03 15:47 UTC
Re: [libvirt-users] Assigning static ip address in libvirt
On 08/02/2016 09:00 AM, harish.shastry@gmail.com wrote:> Hello > > Is there way to assign static ip address to lxc and KVM guests with > libvirt? > > I saw some snippets here > https://libvirt.org/formatdomain.html#ipconfig but unable to get it to > work.That method only works for lxc (only the IP address of the *host* side of the tap device can be configured for qemu guests), and only if your libvirt is at least version 1.2.12. Another method is to add a static host entry to the dhcp configuration for the network used to connect the guest. If the guest interface is connected to a libvirt virtual network, you can just do what is described here: http://wiki.libvirt.org/page/Networking#virsh_net-update Otherwise, if the guest is connected via a bridge (or macvtap) directly to an external network, you'll need to configure the dhcp server for that network (which is outside the scope of libvirt)