# Debugging DHCPv6-PD

**URL:** <https://forum.openwrt.org/t/debugging-dhcpv6-pd/86387>\
**Category:** Installing and Using OpenWrt\
**Created:** [January 23, 2021, 1:47pm UTC](https://forum.openwrt.org/t/debugging-dhcpv6-pd/86387 "2021-01-23T13:47:43Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![oofnik](https://forum.openwrt.org/user_avatar/forum.openwrt.org/oofnik/32/17907_2.png) [@oofnik](https://forum.openwrt.org/u/oofnik)\
**Post date:** [January 25, 2021, 9:18am UTC](https://forum.openwrt.org/t/debugging-dhcpv6-pd/86387/13 "2021-01-25T09:18:40Z")

</div>

I did some reading and some more debugging with a different DHCPv6 client (`dhcpcd5`) on another machine. I got prefix delegation working, which led to me noticing that `odhcp6c` doesn't bother to request a prefix!

> **tcpdump (odhcp6c)**
>
> ```
> 10:47:38.533788 02:42:c0:xx:xx:xx > 33:33:00:01:00:02, ethertype IPv6 (0x86dd), length 164: (flowlabel 0xba444, hlim 1, next-header UDP (17) payload length: 110) fe80::42:c0ff:fexx:xxx.546 > ff02::1:2.547: [udp sum ok] 
> dhcp6 solicit (xid=13b02f (elapsed-time 0) (option-request SIP-servers-domain SIP-servers-address DNS-server DNS-search-list SNTP-servers NTP-server AFTR-Name opt_67 opt_94 opt_95 opt_96 opt_82) (client-ID hwaddr type 1 0242c0xxxxxx) (reconfigure-accept) (Client-FQDN) (IA_NA IAID:1 T1:0 T2:0) (IA_PD IAID:1 T1:0 T2:0))
> 
> 10:47:38.604784 00:13:5f:04:9c:d9 > 02:42:c0:xx:xx:xx, ethertype IPv6 (0x86dd), length 250: (class 0xe0, hlim 255, next-header UDP (17) payload length: 196) fe80::213:5fff:fe04:9cd9.547 > fe80::42:c0ff:fexx:xxx.546: [udp sum ok] 
> dhcp6 advertise (xid=13b02f (client-ID hwaddr type 1 0242c0xxxxxx) (server-ID hwaddr/time type 1 time 661197566 005056a7b22b) (IA_NA IAID:1 T1:1000 T2:2000 (IA_ADDR 2a00:7c40:yyyy:yy::yy pltime:3000 vltime:4000)) (DNS-server 2001:4860:4860::8888 2001:4860:4860::8844) (IA_PD IAID:1 T1:1000 T2:2000 (IA_PD-prefix 2a00:7c40:xxxx:xx::/64 pltime:3000 vltime:4000 (opt_67))) (Client-FQDN))
> 
> 10:47:39.740903 02:42:c0:xx:xx:xx > 33:33:00:01:00:02, ethertype IPv6 (0x86dd), length 192: (flowlabel 0xba444, hlim 1, next-header UDP (17) payload length: 138) fe80::42:c0ff:fexx:xxx.546 > ff02::1:2.547: [udp sum ok] 
> dhcp6 request (xid=f78819 (elapsed-time 0) (option-request SIP-servers-domain SIP-servers-address DNS-server DNS-search-list SNTP-servers NTP-server AFTR-Name opt_67 opt_94 opt_95 opt_96) (client-ID hwaddr type 1 0242c0xxxxxx) (server-ID hwaddr/time type 1 time 661197566 005056a7b22b) (reconfigure-accept) (Client-FQDN) (IA_NA IAID:1 T1:0 T2:0 (IA_ADDR 2a00:7c40:yyyy:yy::yy pltime:3000 vltime:4000)))
> 
> 10:47:39.762081 00:13:5f:04:9c:d9 > 02:42:c0:xx:xx:xx, ethertype IPv6 (0x86dd), length 192: (class 0xe0, hlim 255, next-header UDP (17) payload length: 138) fe80::213:5fff:fe04:9cd9.547 > fe80::42:c0ff:fexx:xxx.546: [udp sum ok] 
> dhcp6 reply (xid=f78819 (client-ID hwaddr type 1 0242c0xxxxxx) (server-ID hwaddr/time type 1 time 661197566 005056a7b22b) (IA_NA IAID:1 T1:1000 T2:2000 (IA_ADDR 2a00:7c40:yyyy:yy::yy pltime:3000 vltime:4000)) (DNS-server 2001:4860:4860::8888 2001:4860:4860::8844) (Client-FQDN))
> 
> ```

In the packet capture above, `odhcp6c` is sending a solicitation with IAID:1 for both the NA and PD. This appears to be **valid** per [RFC8415](https://tools.ietf.org/html/rfc8415#page-37) (the latest official DHCPv6 spec), however the text of the [obsoleted RFC](https://tools.ietf.org/html/rfc3315#page-23) suggests that this is **invalid**. The advertisement that comes back does contain a prefix, but it seems to be ignored by `odhcp6c` in the subsequent request.

By requesting the IA\_NA with IAID:1 and IA\_PD with IAID:2, the server replies with both:

> **tcpdump (dhcpcd5)**
>
> ```
> 10:30:59.920010 IP6 (flowlabel 0x9d36d, hlim 1, next-header UDP (17) payload length: 158) fe80::96c6:91ff:fe19:d715.546 > ff02::1:2.547: [udp sum ok] 
> dhcp6 solicit (xid=826ef5 (client-ID hwaddr/time type 1 time 605303213 3052cbxxxxxx) (elapsed-time 0) (vendor-class) (rapid-commit) (IA_NA IAID:1 T1:0 T2:0) (IA_PD IAID:2 T1:0 T2:0) (reconfigure-accept) (option-request DNS-server DNS-search-list Client-FQDN opt_82 opt_83))
> 
> 10:30:59.958068 IP6 (class 0xe0, hlim 255, next-header UDP (17) payload length: 173) fe80::213:5fff:fe04:9cd9.547 > fe80::96c6:91ff:fe19:d715.546: [udp sum ok] 
> dhcp6 advertise (xid=826ef5 (client-ID hwaddr/time type 1 time 605303213 3052cbxxxxxx) (server-ID hwaddr/time type 1 time 661197566 005056a7b22b) (IA_NA IAID:1 T1:1000 T2:2000 (IA_ADDR 2a00:7c40:yyyy:yy::yy pltime:3000 vltime:4000)) (DNS-server 2001:4860:4860::8888 2001:4860:4860::8844) (IA_PD IAID:2 T1:1000 T2:2000 (IA_PD-prefix 2a00:7c40:xxxx:xx::/64 pltime:3000 vltime:4000)))
> 
> 10:30:59.958586 IP6 (flowlabel 0x9d36d, hlim 1, next-header UDP (17) payload length: 229) fe80::96c6:91ff:fe19:d715.546 > ff02::1:2.547: [udp sum ok] 
> dhcp6 request (xid=28849a (client-ID hwaddr/time type 1 time 605303213 3052cbxxxxxx) (server-ID hwaddr/time type 1 time 661197566 005056a7b22b) (elapsed-time 0) (vendor-class) (IA_NA IAID:1 T1:0 T2:0 (IA_ADDR 2a00:7c40:yyyy:yy::yy pltime:3000 vltime:4000)) (IA_PD IAID:2 T1:0 T2:0 (IA_PD-prefix 2a00:7c40:xxxx:xx::/64 pltime:3000 vltime:4000)) (reconfigure-accept) (option-request DNS-server DNS-search-list Client-FQDN opt_82 opt_83))
> 
> 10:30:59.977262 IP6 (class 0xe0, hlim 255, next-header UDP (17) payload length: 173) fe80::213:5fff:fe04:9cd9.547 > fe80::96c6:91ff:fe19:d715.546: [udp sum ok] 
> dhcp6 reply (xid=28849a (client-ID hwaddr/time type 1 time 605303213 3052cbxxxxxx) (server-ID hwaddr/time type 1 time 661197566 005056a7b22b) (IA_NA IAID:1 T1:1000 T2:2000 (IA_ADDR 2a00:7c40:yyyy:yy::yy pltime:3000 vltime:4000)) (DNS-server 2001:4860:4860::8888 2001:4860:4860::8844) (IA_PD IAID:2 T1:1000 T2:2000 (IA_PD-prefix 2a00:7c40:xxxx:xx::/64 pltime:3000 vltime:4000)))
> 
> ```

Configuring `dhcpcd5` to request both the IA\_NA and IA\_PD with IAID:1 results in exactly the same behavior as observed with `odhcp6c` (no PD in request); in fact it even complains with the following warning:

```
Cannot mix IA for the same IAID 

```

I am running the latest available version of `odhcp6c` as of the time of writing:

```
root@openwrt:~# opkg info odhcp6c
Package: odhcp6c
Version: 2021-01-09-64e1b4e7-16
Depends: libc, libubox20191228
Status: install user installed
Section: net
Architecture: x86_64
Size: 27177
Filename: odhcp6c_2021-01-09-64e1b4e7-16_x86_64.ipk
Description: Embedded DHCPv6-client for OpenWrt
Installed-Time: 1611554546

```

So, the question is: how do I configure `odhcp6c` to request the non-temporary address and delegated prefix with different IAIDs?

Working `dhcpcd5` config file for reference:

> **dhcpcd.conf**
>
> ```
> # IPv6 debug
> allowinterfaces eth0 br0
> duid
> option rapid_commit
> option domain_name_servers, domain_name, domain_search, host_name
> require dhcp_server_identifier
> slaac private
> ipv6only
> debug
> release
> noipv6rs
> 
> interface eth0
> ipv6rs
> ia_na 1
> ia_pd 2/::/0 br0/0/64
> 
> ```

---

_[View the full topic](https://forum.openwrt.org/t/debugging-dhcpv6-pd/86387)._
