Set hostname in DHCP client request

Tell us your most wanted new features, or recommendation.
Locked
User avatar
rogo
Posts: 1
Joined: 14 Sep 2020, 03:21

Set hostname in DHCP client request

Post by rogo »

The TerraMaster NAS busybox udhcp client (udhcpc) does not appear to currently support pushing the client device name to the DHCP server when requesting an IP address. I use static IP reservations for each host on my network and the client should send their hostname to create the name-->IP mapping.

Busybox documentation:
https://udhcp.busybox.net/README.udhcpc
-------------------
The command line options for the udhcp client are:
<snip>
-H, --hostname=HOSTNAME Client hostname
<snip>

I noticed the current command-line for udhcpc is:
udhcpc -i eth1 -S -s /var/nas/udhcps -b -x lease:172800
udhcpc -i bond0 -S -s /var/nas/udhcps -n -x lease:172800

Can you please consider adding the device name stored within Control Panel, Network, General, Device name as a variable that will be sent to the udhcpc client?

suggested udhcpc command line:
udhcpc -i eth1 -S -s /var/nas/udhcps -b -H $devicename -x lease:172800
udhcpc -i bond0 -S -s /var/nas/udhcps -n -x $devicename lease:172800

Thank you!
Locked