ipv6 configuration for kvm guests

I wrote here that I am KVM addicted.I use it for many test cases,it is on my daily hack-menu :),I like it as easy and convenient toot to fire up some virtual machine instance,test something,and later on delete it.

KVM comes with default ipv4 network assigned to virbr0 bridge interface and this works fine for all cases.We can change this default network,and that is not topic of this post.

What if we want to deploy IPV6 ( ipv6 is real necessity these days )?
We can do that too,in order to configure virbr0 to have ipv6 global address ( and thus all guests using it as bridge interface ) it is necessary to follow below process

List virtual networks

#virsh net-list --all
Name State Autostart Persistent
default active yes yes

“stop/destroy” virtual network, end edit it

# virsh net-destroy default

  1. virsh net-edit default

here ‘vim’ will be started and you will get chance to edit kvm virtual network.You will need to add new ‘ip’ segment defining ipv6 addresses you want to use.In my case I added below section related to ipv6 segment

<ip family='ipv6' address='2000:aabb:ccdd:a::1' prefix='64'>

After this you will see new addresses (ipv6 link and global) assigned to virbr0 interface.Next time you start virtual guests,they will get automatically ipv6 ip address and ping6, ssh -6 … and friends will work.