<div dir="ltr"><div dir="ltr">hi,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 21, 2023 at 3:40 PM Michal Prívozník <<a href="mailto:mprivozn@redhat.com">mprivozn@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 3/19/23 20:21, Natxo Asenjo wrote:<br>
> hi,<br>
> <br>
> I have configured a routed network on my laptop with a ipv6 subnet and<br>
> dnsmasq is handing out ipv6 addresses to my vms and it works really wel,<br>
> but finding out which ips have been used is not as easy as with ipv4.<br>
> <br>
> [root@lenovo ~]# virsh domifaddr --domain wec --source lease<br>
>  Name       MAC address          Protocol     Address<br>
> -------------------------------------------------------------------------------<br>
> <br>
> [root@lenovo ~]# virsh domifaddr --domain wec --source arp<br>
>  Name       MAC address          Protocol     Address<br>
> -------------------------------------------------------------------------------<br>
> <br>
> When using a ipv4 network, this works:<br>
> <br>
> root@lenovo ~]# virsh domifaddr --domain evenng --source arp<br>
>  Name       MAC address          Protocol     Address<br>
> -------------------------------------------------------------------------------<br>
>  vnet2      52:54:00:4c:83:98    ipv4         <a href="http://192.168.122.229/0" rel="noreferrer" target="_blank">192.168.122.229/0</a><br>
> <<a href="http://192.168.122.229/0" rel="noreferrer" target="_blank">http://192.168.122.229/0</a>><br>
> <br>
> [root@lenovo ~]# virsh domifaddr --domain evenng --source lease<br>
>  Name       MAC address          Protocol     Address<br>
> -------------------------------------------------------------------------------<br>
>  vnet2      52:54:00:4c:83:98    ipv4         <a href="http://192.168.122.229/24" rel="noreferrer" target="_blank">192.168.122.229/24</a><br>
> <<a href="http://192.168.122.229/24" rel="noreferrer" target="_blank">http://192.168.122.229/24</a>><br>
> <br>
> I can obviously look into the leases file and find out the address, but<br>
> it would be nice to be able to use the virt tooling.<br>
<br>
Looks like you won't find any info for IPv6 there, because that's<br>
exactly what '--source lease' is doing. Are you sure that your IPv6<br>
address is not autoconfigured and it indeed is libvirt spawned dnsmasq<br>
that's assigning the IPv6 address?<br></blockquote><div><br></div><div>this is the xml:</div><div><br></div><div># cat networks/ipv6.xml <br><!--<br>WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE<br>OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:<br>  virsh net-edit ipv6<br>or other application using the libvirt API.<br>--><br><br><network><br>  <name>ipv6</name><br>  <uuid>49957183-e4e4-4541-8746-11be67f0a511</uuid><br>  <forward mode='open'/><br>  <bridge name='virbr1' stp='on' delay='0'/><br>  <mac address='52:54:00:09:8e:66'/><br>  <domain name='ipv6'/><br>  <ip family='ipv6' address='2a02:xxx:xx:7::1' prefix='64'><br>    <dhcp><br>      <range start='2a02:xxx:xx:7::100' end='2a02:xxx:xx:7::1ff'/><br>    </dhcp><br>  </ip><br></network></div><div><br></div><div>so it looks like a dhcp server to me ;-)</div><div><br></div><div>I just found out about virsh net-dhcp-leases and that one lists the leases:<br></div><div><br></div><div># virsh net-dhcp-leases --network ipv6 <br> Expiry Time           MAC address         Protocol   IP address                Hostname          Client ID or DUID<br>---------------------------------------------------------------------------------------------------------------------------------------------<br> 2023-03-22 16:35:44   52:54:00:0e:ee:da   ipv6       2a02:xxx:xx:7::1ba/64   WIN-C0HD8RH61MI   00:01:00:01:2b:a7:05:c5:52:54:00:0e:ee:da</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
For the '--source arp' case - libvirt reads the arp table (effectively<br>
the same info is exposed under /proc/net/arp file) and finds a matching<br>
entry there, based on the MAC address. Can you see whether there's a match?<br></blockquote><div><br></div><div>No, that only entry right now there is my router:</div><div><br></div><div>]# cat /proc/net/arp <br>IP address       HW type     Flags       HW address            Mask     Device<br>xx.x.x.1         0x1         0x2         cafebabecafe     *        wifi0<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
And lastly - there's '--source agent' which is most likely to return<br>
useful information, but that requires guest agent running inside.<br></blockquote><div><br></div><div>Indeed, no agent running on the vm, could add it. <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Michal<br>
<br>
> <br>
> This is on a fedora 37 running qemu-kvm-7.0.0-14.fc37.x86_64 and<br>
> dnsmasq-2.89-1.fc37.x86_64, everything intalled from the fedora<br>
> repositories.<br>
<br>
<br>
So is it safe to assume that libvirt (which is where you're reporting<br>
the issue) is: libvirt-8.6.0-5.fc37 ?<br></blockquote><div><br></div><div>yes: libvirt-8.6.0-5.fc37.x86_64</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Michal<br>
<br>
</blockquote></div><div><br></div><div>So dumping the net-dhcp-leases works also for me, it's just not consequent with the ipv4 behaviour, that's all. <br></div><br><div dir="ltr" class="gmail_signature">--<br>regards,<br>natxo</div></div>