Page MenuHomeVyOS Platform

DHCPv6 DUID configuration node missing
Closed, ResolvedPublicBUG

Description

Supported on VyOS 1.2 series but not migrated over to 1.3

Reported via forums: https://forum.vyos.io/t/setting-custom-duid-for-dhcpv6-no-longer-available-in-1-3

Details

Difficulty level
Normal (likely a few hours)
Version
1.3-rolling
Why the issue appeared?
Implementation mistake
Is it a breaking change?
Perfectly compatible

Event Timeline

c-po triaged this task as Normal priority.
c-po created this task.
c-po changed Why the issue appeared? from Will be filled on close to Implementation mistake.
c-po updated the task description. (Show Details)

It looks like wide dhcp client does not support setting the DUID as it is overwritten again after a restart :(

Accidentally deleted the comment. Is there plan to migrated to dhcpcd instead? dhcpcd has good ipv6 support and being actively maintained too. Thanks.

Sorry I am confused. I took a brief look at the code of dhcp6c and it appears manually modifying the dhcp6c_duid file should be able to keep the change persistent: https://github.com/jinmei/wide-dhcpv6/blob/24ee2a4f0009bc6ac9bd0b7b737aef93a4aa9905/common.c#L992. Did I miss anything? Thanks :)

Undortunately it only worked in 50% of the cases properly. Also there is only one global duid file so you can not have multiple duids (one per each interface).

Thats the current situation :(

Yeah also it looks like wide is hardcoded to support only type 1 DUID (LLT) anyway.... so probably it wasn't accidentally "forgotten" in 1.3 migration that someone probably has realized it wasn't viable to support it... Thanks :)

It still would be nice though. ANy other good IPv6 DHCP clients out there?

dhcpcd is a pretty good alternative. Well maintained and popularly used by many. I used it in a plain Linux router project and it was good enough for my use cases.

Not to sound like a crazy idea but how about networkd? It already has a pretty decent dhcpv6 client built-in it seems. Although I assume being a all-in-one setup it may be more desirable to have a standalone dhcpv6 client

Thanks

I'm on 1.4-rolling-202101100217 and it looks like the DUID command is gone at the interface level or system level. Besides overwriting the DUID file (which seems to not persist between upgrades), is there a good strategy here if the use-case doesn't require a custom DUID per interface?

Can we reopen this bug? I need to set a type 2 DUID to get a DHCPv6 PD from my ISP. This is the only thing keeping me from switching from an EdgeRouter to VyOS.

@stepler for what it's worth, it does seem to persist across reboots if you just overwrite the file but obvs doesn't survive upgrades

@stepler, it looks like WIDE does not support type 2 DUID.

I found a workaround (persists across reboots and upgrades):

cat <<'EOF' >/config/scripts/vyos-preconfig-bootup.script
#!/bin/bash

base64 -d <<<"..." >/var/lib/dhcpv6/dhcp6c_duid
EOF
chmod 775 /config/scripts/vyos-preconfig-bootup.script

To generate the base64 string:

python3 -c 'from binascii import unhexlify; from base64 import b64encode; from struct import pack; duid = "..."; duid = unhexlify(duid.replace(":", "").encode()); print(b64encode(pack("=H", len(duid)) + duid).decode())'

WIDE will only generate type 1 DUIDs, but it will use any type of manually configured DUID.