Problem with DHCP client and forced ClientID in v25.12

Hi OpenWRT community!

After v25.12 I can’t obtain a IP via DHCP from my ISP.
I found where is the problem.
The flag -C on udhcpc request is missing.
I remove in /lib/netifd/proto/dhcp.sh lines 68 and 69 and restore from v24.10 line 54 instead.
Removed lines:
[ -z "$clientid" ] && clientid="$(proto_dhcp_get_default_clientid "$iface")"
[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}"

Replaced with this line from v24.10:
[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"

Now udhcpc work perfectly for me.

Can you add a option to remove clientid when DHCP is used?

Router: D-Link DIR-860L B1 - OpenWRT v25.12

Thank you!

Greetings,
mmg

Also see here: #21671 with proposed solution here. But due to the lack of reactions, I reckon this is not wanted by the relevant devs, so I didn't PR it.

I'd suggest someone who's actually affected send a PR (feel free to copy my proposal, no credit needed). I'm not affected and therefore can't argue that the changed behavior broke anything for me.

Yeah… I hope someone will correct this.

To make it clear, it's not incorrect, so there's nothing to "correct".

Technically, it's fully correct and in accordance with RFC4361.

But it's a breaking change which, in addition, doesn't work with certain ISPs. Such a change shouldn't be enforced with no way of going back to the previous, working behavior. It makes the product, without any need, unusable for a certain group of users.

But again, this is only my personal opinion. I'm puzzled from a product management and/or support point of view. As a user, I'm not affected, so I won't fight for or against the actual change.

Instead, I'm arguing towards proper phase-in/phase-out of features. Ie., the first step should've been to add RFC4361 compliance only as an optional feature. Later perhaps make it default with possibility to turn it off, and only as a very last step, far in the future (and only in case sufficient adoption has taken place), maybe enforce it.

Edit: Looks like the point has been taken in issue #22332 by the dev who originally implemented the option 61 enforcement. So it could be that we'll see an update to this more or less soon.

I totally agree with you. This is only a “proposed standard”, it hasn’t been adopted yet.

I’m fine with this new feature, but I’d like an option (a checkbox or toggle) to disable it. That’s all I need.

I’ve found a workaround for myself, but many other users probably won’t.

@mmg You saved my day! I wish they included it in the official release

i have same problem with Xiaomi ax3000t. but this solution did not work for me.

Open an SSH console and run this command:
udhcpc -f -i wan -C

If your router still does not obtain an IP address via DHCP, there may be a different issue.

Thank you so much, that really helped.

Struggling to get WAN ip on my nanopi r5s, tried the command suggested above, udhcpc -f -i wan -C, got this error: SIOCGIFINDEX: no such device

Went back to 24.10.6 worked right away

Maybe “wan” is not your interface.
Check the interfaces with that command:
uci show network | grep "=interface"

Example output:
network.loopback=interface
network.lan=interface
network.wan=interface
network.wan6=interface

In the command udhcpc -f -i wan -C , “wan” is network.wan interface on my router. That’s my principal wan port and I use only IPv4.

I’ve fought this issue today and I saw that’s indeed the issue here. As I wanted to stay as close as possible to default openwrt implementation even though this breaking change for those of us tied by their ISPs, I deceded to implement a bit different approach.

I’ve added that line in /lib/netifd/proto/dhcp.sh

--- /root/dhcp.sh 2026-03-28 16:29:16.128787217 +0200

+++ /lib/netifd/proto/dhcp.sh 2026-03-28 13:33:37.850000494 +0200

@@ -67,6 +67,7 @@

  [ "$norelease" = 1 ] && norelease="" || norelease="-R"

  [ -z "$clientid" ] && clientid="$(proto_dhcp_get_default_clientid "$iface")"

  [ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}"

+ [ "$clientid" == "-x 0x3d:00" ] && clientid="-C"

  [ -n "$vendorid" ] && append dhcpopts "-x 0x3c:$(echo -n "$vendorid" | hexdump -ve '1/1 "%02x"')"

  [ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"

  [ "$iface6rd" != 0 -a -f /lib/netifd/proto/6rd.sh ] && append dhcpopts "-O 212"

What it does?
If you go to Network→Interfaces→Wan→Edit→Advanced Settings you will see the following option

Client ID to send when requesting DHCP:

If you apply that patch and set that clientid to 00 (no offense to devs, its just hex :wink: ) your udhcp will puth that -C flag which will suppress client id in dhcp requests.

Hope in the next minor release someone add an option to suppress the client Id.

Regards,
Kamen

Just a hint, POSIX shell uses a single = for string comparisons - some shells are more lenient than others, but == is invalid for if/ test according for POSIX/ SUSv4.

i am away from router about 600 kilometers. so I cannot try this right now.

but I wonder 25.12.2 solve this problem?

I just tried this command and router obtained ip address. what should I do now?

I don't know Xiaomi ax3000t , but look at my first post here. That's only solution for now. Probably your router have similar DHCP script in another directory, check it.

I made the changes mentioned in the first post, but after rebooting, it reverts back to version 25.12. What should I do to make the changes permanent?

That's strange. You are sure, that changes are saved and uploaded successfully in the router memory? :thinking:

I connected via ssh and edit in place. also I checked after save. I saw changes. but after reboot, poooffff. all changes gone and restore 25.12

I had tested with SSH and "vi" editor, using "root" user.
The changes are saved by ":wq" command in the editor and the router had rebooted via "reboot".
All is fine and changes are permanent.
I don't have same problem on my router and I can't help you.