Bug 1195281

Summary: RFE: print link-local IPv6 address of a VM with NIC(s) plugged to bridge(s)
Product: Red Hat Enterprise Linux 7 Reporter: David Jaša <djasa>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.1CC: djasa, dyuan, honzhang, mzhan, rbalakri
Target Milestone: rcKeywords: FutureFeature
Target Release: 7.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-05-07 07:49:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Jaša 2015-02-23 14:23:43 UTC
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:
fe80::1122:33ff:fe44:5566%virbr0
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>
network:libvirt_network_name ipv6_link-local-addr
bridge:bridge_name ipv6_link-local_addr

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

Comment 1 Michal Privoznik 2015-05-06 12:28:13 UTC
David,

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?

Comment 2 Michal Privoznik 2015-05-06 12:32:55 UTC
(In reply to Michal Privoznik from comment #1)
> David,
> 
> 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.

Comment 3 Michal Privoznik 2015-05-07 07:49:16 UTC
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 ***