[libvirt-users] IPV6 configuration

Laine Stump laine at laine.org
Mon Nov 26 15:33:45 UTC 2012

On 11/13/2012 04:05 PM, Patrick Chemla wrote:
> Hi,
> I am running package libvirt- on a
> kernel-3.6.5-1.fc17.x86_64 Fedora 17.
> I have set up the host with an IPv6 address, and I made some
> successfull tests transferring in IPv6 mode to/from other hosts.
> I want to set up libvirt to get an IPv6 address for his local network
> interface, same for the guests.
> I want the guests to be able to communicate directly on the internet
> through this ipv6 address.
> I have had a <ip family="ipv6" address="2001:xxxxxxx" /> line to the
> /etc/libvirtd/qemu/network/default.xml file but when I restart the
> host, this line disappears and no ipv6 address is added to the libvirt
> interface.

Never edit the XML files in /etc/libvirt directly - their use is
exclusively internal to libvirtd and the results are officially
"unpredictable" (in this case, libvirt happens to overwrite the file
with its own internal state). Instead, use the libvirt API (or its shell
extension, virsh). To modify a network definition, you would use "virsh
net-edit $networkname" (virsh uses the editor specified in the EDITOR
environment variable, or /usr/bin/vi if EDITOR isn't set.)

Once you've edited the network, you will need to restart it. Use:

   virsh net-destroy $networkname && virsh net-start $networkname

Note that any guests connected to that network will need to be restarted
(or alternately, their interfaces will need to be detached and re-attached).

> I have added an ipv6 address to the guest in the same range of the
> host address. I can ping6 the address locally on the guest, but can't
> access the host.
> Is there somewhere a howto-libvirt-ipv6 to understand how to set up
> the whole stuff?

It's not the IPv6 part that you didn't get, it's the more basic "How do
I modify a libvirt network definition". There isn't really much to the
IPv6 support on libvirt's networks - you just ad an <ip> element with
family='ipv6' (and make the prefix='64' if you want address autoconf to

More information about the libvirt-users mailing list