dracutdevs / dracut

dracut the event driven initramfs infrastructure
https://github.com/dracutdevs/dracut/wiki
GNU General Public License v2.0
599 stars 398 forks source link

Nameservers not retrieved from dhcp6 server #998

Closed Anvil closed 3 years ago

Anvil commented 3 years ago

Describe the bug The dracut-embedded dhclient configuration does not allow dhclient to retrieve name servers from DHCPv6 server.

My team and I are working in an IPv6-only environment, and are currently using dracut to download a live image located on a remote http://server.internal/foo.squashfs URL. While specifying the IPv6 address instead of server.intenal name is currently working, the DNS resolution itself does not, because resolv.conf is empty.

Distribution used arch

Dracut version 050

Init system systemd

To Reproduce

  1. Setup an ISC KEA dhcp6 server. The configuration should have an option-data->dns-servers configuration as specified in documentation with at least one IPv6 address (For the purpose of this report, let's use ::dead:beef)
  2. Specify the following kernel command line arguments: ip=dhcp6 rd.shell=1 rd.peerdns=1 rd.break=pre-mount
  3. When reaching dracut initramfs interactive shell, check /etc/resolv.conf

Expected behavior The /etc/resolv.conf file should contain at least a nameserver ::dead:beef line. (or at least the /tmp/net.*.resolv.conf files generated by dhclient-script should mention ::dead:beef - I don't remember exactly when /etc/resolv.conf is generated by dracut, sorry)

Additional context We investigated the issue, and it has to do with the dhclient.conf file provided by dracut. In order to retrieve DNS information from DHCPv6 server, dhcp6.name-servers needs to be listed in the request configuration directive of dhclient.conf. At least that's how we worked around this issue.

We did not need them at the time, but other DHCPv6 options, (like the dhcp6.* options you can find on https://kb.isc.org/docs/isc-dhcp-44-manual-pages-dhcp-options) could also prove useful and I would suggest putting the DHCPv6 equivalent of all already-present DHCPv4-specific options.

Anvil commented 3 years ago

Hey, there. Happy new year. What's up on this issue ?

Anvil commented 3 years ago

Ping ?

Anvil commented 3 years ago

Thank you @haraldh and @johannbg