How does linux know to run dhcpv6 on the client?


I'm playing with ipv6 on my home network. I'm trying to understand how a linux client (on ubuntu 16.04, if that matters) knows to talk to the dhcpv6 server (either for an IP address or to get DNS servers). It seems that a lot of this is done from the kernel, as when I do:

$ sudo ifup --verbose p2p1

I see among the output

/sbin/sysctl -q -e -w net.ipv6.conf.p2p1.accept_ra=2
/sbin/sysctl -q -e -w net.ipv6.conf.p2p1.autoconf=1

I also see a lot of dhcpv4 messages in that output, but I don't see anything dhcpv6 related.

I also see that my router is advertising that there's other configuration available:

$ rdisc6 p2p1
Soliciting ff02::2 (ff02::2) on p2p1...

Hop limit                 :           64 (      0x40)
Stateful address conf.    :          Yes
Stateful other conf.      :          Yes
Router preference         :       medium
Router lifetime           :         1800 (0x00000708) seconds
Reachable time            :  unspecified (0x00000000)
Retransmit time           :  unspecified (0x00000000)
 Prefix                   : 2601:xxx:xxx:xxx::/64
  Valid time              :         3600 (0x00000e10) seconds
  Pref. time              :         3600 (0x00000e10) seconds
 Prefix                   : fd0f:e273:26d2::/64
  Valid time              :         3600 (0x00000e10) seconds
  Pref. time              :         3600 (0x00000e10) seconds
 MTU                      :         1500 bytes (valid)
 Source link-layer address: BC:AE:C5:C3:0A:55
 Recursive DNS server     : 2601:xxx:xxx:xxx::1
  DNS server lifetime     :         3600 (0x00000e10) seconds
 from fe80::beae:c5ff:fec3:a55

But I'm clearly missing the piece where something decides to invoke dhclient -6.


$ cat /etc/network/interfaces | tail -5
# The primary network interface
auto p2p1
iface p2p1 inet dhcp
# This is an autoconfigured IPv6 interface
iface p2p1 inet6 auto

If I change the last line to:

iface p2p1 inet6 dhcp

Then it all makes sense to me. But I want to stick with auto, because that seems to be how ipv6 is supposed to work.

I started down this path because isc-dhcp-client doesn't send a dhcp6 query at all (verified with tcpdump on my openwrt), but dhcpc5 does. But switching to dhcp5c causes network-manager to be uninstalled, which leads to other pain. Once I started looking, I figured I might as well learn to fish. I expect tracking down my exact issue should be straight forward after I know how dhclient -6 is actually invoked.

Thanks, Craig

asked on Super User Oct 29, 2016 by Craig Howard

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0