[libvirt-users] Assigning IPv6 address to guest

Bhasker C V bhasker at unixindia.com
Sun Oct 5 16:56:54 UTC 2014


On 05/10/14 17:24, The Cop wrote:
> On 10/5/2014 1:56 AM, Bhasker C V wrote:
>> On 04/10/14 21:13, The Cop wrote:
>>> On 10/4/2014 8:46 PM, Bhasker C V wrote:
>>>> On 04/10/14 15:36, The Cop wrote:
>>>>> Hello,
>>>>>
>>>>> I am trying to assign an IPv6 address to one of my guests. I followed the
>>>>> following guide, unsuccessfully:
>>>>>
>>> https://www.berrange.com/posts/2011/06/16/providing-ipv6-connectivity-to-virtual-guests-with-libvirt-and-kvm/
>>>>> .
>>>>>
>>>>> I have the following config files:
>>>>> dumpxml of the guest `deb`: http://sprunge.us/iUef
>>>>> net-dumpxml of network `default`: http://sprunge.us/WTfH
>>>>> net-dumpxml of network `ip6`: http://sprunge.us/YEXc
>>>>>
>>>>> Host:
>>>>> ifconfig: http://sprunge.us/cJOg
>>>>> Routing table: IPv6: http://sprunge.us/GChZ IPv4: http://sprunge.us/dACN
>>>>> /etc/network/interfaces: http://sprunge.us/fHcf
>>>>> /var/lib/libvirt/radvd/ip6-radvd.conf: http://sprunge.us/JcfF
>>>>> ip6tables: http://sprunge.us/JGBG
>>>>> uname -a: http://sprunge.us/acFF
>>>>>
>>>>> Guest:
>>>>> ifconfig: http://sprunge.us/JIFN
>>>>> Routing table: IPv6: http://sprunge.us/ZPfT IPv4: http://sprunge.us/gbXA
>>>>> /etc/network/interfaces: http://sprunge.us/ZaBB
>>>>> uname -a: http://sprunge.us/CFFL
>>>>>
>>>>> Both machines are running Debian Wheezy. virsh version is 0.9.12.3.
>>> The IP
>>>>> address I'm trying to assign to the guest is "2607:5300:60:1156::2/64".
>>>>> Forgive me if I'm making some trivial mistake, but this is more or
>>> less the
>>>>> first time I'm productively using IPv6.
>>>>>
>>>>> Thanks
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> libvirt-users mailing list
>>>>> libvirt-users at redhat.com
>>>>> https://www.redhat.com/mailman/listinfo/libvirt-users
>>>>>
>>>> I assume you are using two different IPV6 address for the two machines.
>>>> I gave a quick scan of your mail but could not find what exactly is
>>> the issue you are facing ?
>>>> Are you not able to ping ? Is the IP not getting assigned ?
>>>> Are you able to ping link-local addresses  ?
>>>> what does  this command output look like ?
>>>> ip -6 nei
>>> I am using two different IPv6 addresses for the two different machines.
>>> I am unable to ping outside from the VM or connect otherwise via IPv6
>>> from the VM. I am also unable to ping the link-local addresses of the
>>> eth1 interface on the VM (via `ping6 fe80::5054:aaff:fe00:f057/64`).
>>> ip -6 nei on the VM gives me:
>>> `fe80::5054:ff:fe1d:a4bb dev eth1 lladdr 52:54:00:1d:a4:bb router STALE`
>>>
>>>
>> Hi,
>>
>>   Your setup shows
>> virbr2 and br0 both on the same network  2607:5300:60:1156::2/64 which
>> will cause issues with routing. This however must not affect the pinging
>> of link-local addresses
>>
>> ON the virtual machine:
>> 	ping -I <eth0> <link-local of server>
>>   must work.
>> If not
>>    check both side link-local addresses if they are set.
>>
>> A quick way to check with "any-body on the segment please reply" is to
>> on virtual machine
>> ping6 -I <eth0>  ff02::1
>> You must see 2 addresses (one is your own link-local and the other is
>> the address on the server)
>>
>> Example in my case is pasted (there are 4 machines):
>>
>> $ ping6 -I n1 ff02::1
>> PING ff02::1(ff02::1) from fe80::2c3b:53ff:fea0:9d26 n1: 56 data bytes
>> 64 bytes from fe80::2c3b:53ff:fea0:9d26: icmp_seq=1 ttl=64 time=0.099 ms
>> 64 bytes from fe80::c4a2:78ff:fe7d:af8d: icmp_seq=1 ttl=64 time=0.590 ms
>> (DUP!)
>> 64 bytes from fe80::5054:ff:fe12:3456: icmp_seq=1 ttl=64 time=0.967 ms
>> (DUP!)
>> 64 bytes from fe80::5054:ff:fe12:3457: icmp_seq=1 ttl=64 time=2.10 ms (DUP!)
>> 64 bytes from fe80::2c3b:53ff:fea0:9d26: icmp_seq=2 ttl=64 time=0.097 ms
>> 64 bytes from fe80::c4a2:78ff:fe7d:af8d: icmp_seq=2 ttl=64 time=0.318 ms
>> (DUP!)
>> 64 bytes from fe80::5054:ff:fe12:3456: icmp_seq=2 ttl=64 time=0.701 ms
>> (DUP!)
>> 64 bytes from fe80::5054:ff:fe12:3457: icmp_seq=2 ttl=64 time=1.06 ms (DUP!)
>> ^C
>> --- ff02::1 ping statistics ---
>> 2 packets transmitted, 2 received, +6 duplicates, 0% packet loss, time
>> 1001ms
>>
>>
>> If link-local address cannot be ping-ed then try pinging ::1.
>>
> Pinging link-local address via `ping6 -I eth1 fe80::5054:ff:fe1d:a4bb`
> works now. Could you elaborate on virbr2 and br0 being on the same
> network please?
As per the networking rules, there can be only one network segment on a 
given device. i.e there must not be a ambiguity on which interface to 
take to reach a network. This is the exact same rules which apply to an 
IPV4 network.

Now that the link-local addresses can be ping-ed, these addresses can be 
used to route packets to outside of the VM.

The IP on the VMs must be 2 different IPs and the 3rd common IP (say 
2607:5300:60:1156::3/64 ) can be assigned to either br0 or virbr0 
whichever is common bridge to both the VMs. Once this is achieved then 
you will start seeing packets going through fine.
Because if I'm seeing this correctly, br0 has
> `2607:5300:60:1156::1/64` and virbr2 has `2607:5300:60:1156::2/64` and
> those are two completely different addresses, right?
>
They indeed are 2 different IPs but they belong to the same subnet. So 
the machine is confused on which interface to use when it has to reach a 
host on a network (there are some very complicated redundant link 
networks which use this kind of networking but I guess what we are 
discussing does not fall under this)
May be this will help: http://www.youtube.com/watch?v=EkNq4TrHP_U





More information about the libvirt-users mailing list