Re: DHCPv6 IA_PD - how-to

From: Roy Marples <roy_at_marples.name>
Date: Tue, 30 Jul 2024 14:44:21 UTC
 ---- On Tue, 30 Jul 2024 15:06:17 +0100  Karl Denninger  wrote --- 
 >         Ok so I have a "new problem" attempting to use dhcp6c for BOTH      IPv4 and IPv6.
 >     This is the salient part of the configuration file (the rest is      basically defaults):
 >     # Generate SLAAC address using the Hardware Address of the      interface
 >       #slaac hwaddr
 >       # OR generate Stable Private IPv6 Addresses based from the DUID
 >       #slaac private
 >       
 >       allowinterfaces igb0
 >       
 >       #ipv6only
 >       #ipv4only
 >       
 >       #
 >       # Do not run these hooks; DO run the DDNS one in exit-hooks
 >       #
 >       nohook resolv.conf hostname ntp.conf
 >       
 >       interface igb0
 >               ia_na 1
 >               ia_pd 1/::/56 igb1/0/64 igb1.4/1/64
 >       
 >       If I do "ipv6only" and run dhcpcd -T then I do get a prefix:
 >     root@IpGw:/usr/local/etc # dhcpcd -T
 >       dhcpcd-10.0.8 starting
 >       DUID 00:01:00:01:2e:3a:76:f1:00:0d:b9:46:71:88
 >       igb0: IAID b9:46:71:88
 >       igb0: IA type 3 IAID 00:00:00:01
 >       igb0: IA type 25 IAID 00:00:00:01
 >       igb0: soliciting a DHCPv6 lease
 >       igb1: activating for delegation
 >       igb1: IAID b9:46:71:89
 >       igb1.4: activating for delegation
 >       igb1.4: IAID ff:00:00:04
 >       igb0: soliciting an IPv6 router
 >       igb0: ADV 2600:6c5d:7009:600:c5e0:25ed:b364:36c2/128 from      fe80::201:5cff:fe70:7c46
 >       igb0: REPLY6 received from fe80::201:5cff:fe70:7c46
 >       interface=igb0
 >       pid=3395
 >       protocol=dhcp6
 >       reason=TEST
 >       skip_hooks='resolv.conf hostname ntp.conf'
 >       ifcarrier=up
 >       ifflags=34883
 >       ifmetric=1001
 >       ifmtu=1500
 >       ifwireless=0
 >       new_dhcp6_client_id=000100012e3a76f1000db9467188
 >       new_dhcp6_domain_search=search.charter.net
 >       new_dhcp6_ia_na1_ia_addr1=2600:6c5d:7009:600:c5e0:25ed:b364:36c2
 >       new_dhcp6_ia_na1_ia_addr1_pltime=3337
 >       new_dhcp6_ia_na1_ia_addr1_vltime=3337
 >       new_dhcp6_ia_na1_iaid=00000001
 >       new_dhcp6_ia_na1_t1=1537
 >       new_dhcp6_ia_na1_t2=2617
 >       new_dhcp6_ia_pd1_iaid=00000001
 >       new_dhcp6_ia_pd1_prefix1=2600:6c5d:5d00:9d00::
 >       new_dhcp6_ia_pd1_prefix1_length=56
 >       new_dhcp6_ia_pd1_prefix1_pltime=3337
 >       new_dhcp6_ia_pd1_prefix1_vltime=3337
 >       new_dhcp6_ia_pd1_t1=1537
 >       new_dhcp6_ia_pd1_t2=2617
 >       new_dhcp6_name_servers='2607:f428:ffff:ffff::1      2607:f428:ffff:ffff::2'
 >       new_dhcp6_server_id=000100012261b73d00144f9bcc84
 >       dhcpcd exited
 >     
 >     This looks ok.  That prefix is good and I presume if I let it set      the other interfaces it will be ok.
 >     
 >     But if I do not say "ipv6only", leaving it that commented out so      I can get both, I get on dhcpcd -T:
 >     root@IpGw:/usr/local/etc # dhcpcd -T
 >       dhcpcd-10.0.8 starting
 >       DUID 00:01:00:01:2e:3a:76:f1:00:0d:b9:46:71:88
 >       igb0: IAID b9:46:71:88
 >       igb0: IA type 3 IAID 00:00:00:01
 >       igb0: IA type 25 IAID 00:00:00:01
 >       igb0: soliciting a DHCPv6 lease
 >       igb1: activating for delegation
 >       igb1: IAID b9:46:71:89
 >       igb1.4: activating for delegation
 >       igb1.4: IAID ff:00:00:04
 >       igb0: rebinding lease of 71.15.253.203
 >       igb0: leased 71.15.253.203 for 2813 seconds
 >       interface=igb0
 >       pid=3358
 >       protocol=dhcp
 >       reason=TEST
 >       skip_hooks='resolv.conf hostname ntp.conf'
 >       ifcarrier=up
 >       ifflags=34883
 >       ifmetric=1001
 >       ifmtu=1500
 >       ifwireless=0
 >       old_broadcast_address=255.255.255.255
 >       old_dhcp_lease_time=3600
 >       old_dhcp_message_type=5
 >       old_dhcp_rebinding_time=3150
 >       old_dhcp_renewal_time=1800
 >       old_dhcp_server_identifier=96.33.192.1
 >       old_domain_name_servers='71.10.216.1 71.10.216.2'
 >       old_interface_mtu=1500
 >       old_ip_address=71.15.253.203
 >       old_network_number=71.15.252.0
 >       old_routers=71.15.252.1
 >       old_subnet_cidr=22
 >       old_subnet_mask=255.255.252.0
 >       new_broadcast_address=255.255.255.255
 >       new_dhcp_lease_time=2813
 >       new_dhcp_message_type=5
 >       new_dhcp_rebinding_time=2363
 >       new_dhcp_renewal_time=1013
 >       new_dhcp_server_identifier=96.33.192.1
 >       new_domain_name_servers='71.10.216.1 71.10.216.2'
 >       new_interface_mtu=1500
 >       new_ip_address=71.15.253.203
 >       new_network_number=71.15.252.0
 >       new_routers=71.15.252.1
 >       new_subnet_cidr=22
 >       new_subnet_mask=255.255.252.0
 >       dhcpcd exited
 >       
 >     
 >     And if I actually boot the machine that way (rather than run it in    test) I get only IpV4; the v6 solicitation never happens.    

Don't use -T in the real world. It will exit once one address family completes.
You probably want the --noconfigure option.

Roy