Comment 3 for bug 1716063

Revision history for this message
Christian Ehrhardt  (paelzer) wrote : Re: libvirt manager configured dhcpv6 network does not appear to sned domain

I set up three Artful VMs:
1. one with a dnsmasq in it.
2. the other one to correctly remote request from it
2. the other one to correctly remote request from it (but via dhcpcd instead of isc-dhcp)
3. Added an extra separate virtual network without dhcp from the host where all those guests can reach each other

Guest:
    <interface type='network'>
      <source network='noextdhcp'/>
      <model type='virtio'/>
    </interface>

Network definition:
  <network>
    <!-- dumb network -->
    <name>noextdhcp</name>
    <bridge name='virbrnoextdhcp'/>
  </network>

This gave me an unconfigured and also otherwise bare "ens7" device in all three guests.
The main guest got a static ipv6 set up like:
 auto ens7
 iface ens7 inet6 static
 address 2607:f0d0:2001:000a:0000:0000:0000:0010
 netmask 64
 gateway 2607:f0d0:2001:000a:0000:0000:0000:0001
 iface ens7 inet static
 address 10.4.0.1
 netmask 255.0.0.0
 gateway 10.4.0.1

Which gives:
$ ip -6 address show ens7
3: ens7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 2607:f0d0:2001:a::10/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fef1:a702/64 scope link
       valid_lft forever preferred_lft forever

The dnsmasq config I tried is:
interface=ens7
no-resolv
# uplink dns by host libvirt
server=192.168.122.1
# basic setup
bogus-priv
enable-ra
dhcp-range=::100,::1ff,constructor:ens7
dhcp-authoritative
# define domain as test1
local=/test1/
domain=test1
dhcp-fqdn
# enable logging
log-queries
log-dhcp

# killing old lease
$ sudo dhcpcd5 --release ens7; sudo dhcpcd5 --exit ens7; sudo kill $(pidof dhcpcd5); sudo rm /var/lib/dhcpcd5/dhcpcd-ens7.lease6
# refresh
$ sudo dhcpcd5 -d ens7 --ipv6only

The same with dhclient now:
# release old lease
sudo dhclient -6 -r ens7
# get a new ipv6 one
sudo dhclient -6 -v ens7

Now what I see as difference between the two clients
# dhclient:
sent size: 14 option: 1 client-id 00:01:00:01:21:49:07:75:52:54:00:8e:c2:c6
sent size: 14 option: 2 server-id 00:01:00:01:21:48:f1:2e:52:54:00:04:69:2e
sent size: 40 option: 3 ia-na IAID=9355974 T1=1800 T2=3150
nest size: 24 option: 5 iaaddr 2607:f0d0:2001:a::172 PL=3600 VL=3600
sent size: 9 option: 13 status 0 success
sent size: 16 option: 23 dns-server 2607:f0d0:2001:a::10
# but dhcpcd5
sent size: 14 option: 1 client-id 00:01:00:01:21:48:ed:66:52:54:00:44:dd:64
sent size: 14 option: 2 server-id 00:01:00:01:21:48:f1:2e:52:54:00:04:69:2e
sent size: 0 option: 14 rapid-commit
sent size: 40 option: 3 ia-na IAID=359429 T1=1800 T2=3150
nest size: 24 option: 5 iaaddr 2607:f0d0:2001:a::134 PL=3600 VL=3600
sent size: 9 option: 13 status 0 success
sent size: 1 option: 7 preference 255
sent size: 16 option: 23 dns-server 2607:f0d0:2001:a::10
sent size: 32 option: 39 FQDN artful-dnsmasqv6-client.test1

Checking what the leases contain this is the same, the dhcpcd lease has the domain name as FQDN, but dhclient holds nothing it seems.
# dhclient
$ sudo cat /var/lib/dhcp/dhclient6.leases | grep test1
# dhcpcd
$ sudo dhcpcd5 --dumplease ens7 --ipv6only | grep test1
dhcp6_fqdn='artful-dnsmasqv6-client.test1'

But there is no real "Domain name" option being passed.

I cross checked by setting the server and clients for ipv4 and otherwise doing the same.
There I see the domain-name being passed:
# dhcdpcd
sent size: 5 option: 15 domain-name test1
# dhclient
sent size: 5 option: 15 domain-name test1

So far all this is without libvirt, which means we can mark that part of the tasks invalid.
I thought I found an option in [1], but "dhcp-option=option6:domain-name" doesn't exist.
I found that dnsmasq lists what it thinks it can pass.

$ dnsmasq --help dhcp6 | grep -i domain
 21 sip-server-domain
 24 domain-search
 29 nis-domain
 30 nis+-domain
$ dnsmasq --help dhcp | grep -i domain
 15 domain-name
 40 nis-domain
 64 nis+-domain
119 domain-search

See that there is no domain-name in the dhcp6 case.

Trying to further limit the packages we have to search by changing from dnsmasq to isc-dhcp-server.
$ cat /etc/dhcp/dhcpd.conf | grep -v '^#'
option domain-name "test1.org";
option domain-name-servers ns1.test1.org, ns2.test1.org;
default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
subnet 10.4.0.0 netmask 255.255.0.0 {
  range 10.4.0.100 10.4.0.254;
}

$ cat /etc/dhcp/dhcpd6.conf | grep -v '^#'
default-lease-time 2592000;
preferred-lifetime 604800;
option dhcp-renewal-time 3600;
option dhcp-rebinding-time 7200;
allow leasequery;
option dhcp6.domain-search "test.test1.com","test1.com";
option dhcp6.info-refresh-time 21600;
subnet6 2607:f0d0:2001:a::/64 {
        range6 2607:f0d0:2001:a::100 2607:f0d0:2001:a::1ff;
}

With that in place we have two things to realize:
1. no domain-name config for dhcpd6.conf available
2. clients get domain-name only on ipv4 requests/leases

Maybe dhclient has to ask for the option(s) explicitly? I really struggle (not a dhcp expert) is it even meant to pass domain-name in ipv6 - I don't know?
I'd almost assume ipv6-dhcp has no domain-name attribute/option?
I Can't see more yet, maybe you can share your dnmasq.conf as well and maybe you even have a lead at where the issue might be already?

[1]: https://egustafson.github.io/ipv6-dhcpv6.html