Description of problem:
IPv6 link-local address is derived from MAC address and interface name where the packets to the address should be sent. This mechanism could be used to reach VMs without need to sniff network traffic (like in case of IPv4/DHCP). The link-local address for NIC with MAC address 11:22:33:44:55:66 plugged to bridge virbr0 is:
The implementation for virsh could add a command that would print NICs plugged to bridges with their respective link-local addresses:
$ virsh <command_to_get_ivp6_ll_addresses> <vm_name>
Maybe the output could be better formatted but IMO this could be a good starting point.
Version-Release number of selected component (if applicable):
RHEL 7.1 / libvirt-client-1.2.8-16.el7.x86_64
I think 'virsh domifaddr' is what you're looking for. It doesn't print a linklocal address though, but instead both ipv4 and ipv6 addresses for all interfaces of a domain. I think it has much broader use case than this one. Do you agree?
(In reply to Michal Privoznik from comment #1)
> I think 'virsh domifaddr' is what you're looking for. It doesn't print a
> linklocal address though, but instead both ipv4 and ipv6 addresses for all
> interfaces of a domain. I think it has much broader use case than this one.
> Do you agree?
Oh, I am a giddy goat. I've configured IPv6 for my guests and now it does report a link local addresses too.
So I was giving this some thinking, and the only thing we can do here is to rely on 'domifaddr'. Guests can manipulate their link-local addresses. Moreover, there are some private extensions to IPV6 which does not generate link-local address from interface MAC address but from PRNG. Having said all of that if libvirt would just compute the address and printed it out it would have no information value.
*** This bug has been marked as a duplicate of bug 1179729 ***