Page 1 of 1

switching to dhcp6leased on OpenBSD 7.6+

Posted: Fri Jan 03, 2025 12:54 pm
by joemiller
Posting this as a bit of a PSA since I couldn't find the answer anywhere else.

I have been using ipv6 w/ DHCPv6-PD on sonic for a couple years w/ OpenBSD using dhcpcd from ports and recently wanted to switch to the new dhcp6leased added to the base system in OpenBSD 7.6. It took me a little bit of debugging to make the switch, however. Here's what I ran into and I hope this helps someone else in the future.

> NOTE: This is moot if you have not already connected to the sonic network and obtained a v6 prefix delegation. So, if you're setting up ipv6 PD for the first time, you can probably ignore this whole post.

The summary of it is: Sonic's dhcp servers were ignoring dhcp6leased's dhcp6 IA_PD Request packets. I had to first release the previous PD that was held in dhcpcd's statefile by starting dhcpcd (`rcctl start dhcpcd`) then running `doas dhcpcd -k` to send an IA_PD Release packet. After that I was able to shutdown dhcpcd and start dhcp6leased. At which point I was able to
get a new prefix delegation.

I noticed this by running `tcpdump -i igc0 -n -vv '(udp port 546 or 547)'` (igc0 is my external nic connected to the ONT). When dhcp6leased starts up it was sending 'IA_PD Request' packets and never received a reply. When I started dhcpcd it was sending `IA_PD Rebind` packets and sonic's dhcp6 servers immediately replied with "sure, keep that prior PD I handed out". I came across another post on these forums about IA_PD Release packets and googled for ways to force dhcpcd to release a PD and discovered `dhcpd -k` in the Arch wiki.