Persisting DHCP hostname across Debian Core container reboot

tony6227

New Member
Feb 26, 2020
8
0
1
UK
Using the Debian 10 Turnkey Core container image, I can't get the container to send it's DHCP hostname to the DHCP server on boot.
I can manually add the hostname to /etc/network/interfaces but this file is reset after a shutdown/start.
Googling seems to suggest I need configuration options in /etc/systemd/network or /etc/systemd/networkd.conf but I just can't nail it.

Can anyone help?

Many thanks.
 
Using the Debian 10 Turnkey Core container image, I can't get the container to send it's DHCP hostname to the DHCP server on boot.
I can manually add the hostname to /etc/network/interfaces but this file is reset after a shutdown/start.
Googling seems to suggest I need configuration options in /etc/systemd/network or /etc/systemd/networkd.conf but I just can't nail it.
The hostname has to be configured in WEB GUI by Container Configuration -> 'DNS' -> 'Hostname'
 
The hostname is set correctly on the "Network Configuration" page of the Webmin UI,
but it still isn't being sent as a DHCP option (#12 I believe) to the DHCP server.

I can force it manually from the command line with...

# udhcpc renew -x hostname:TESTBOX

After running this, the hostname TEXTBOX now appears in the DHCP leases on my pfSense box.
I've tried specifying udhcpc options for eth0 in /etc/dhcp/dhclient.conf but that didn't work.
Some online sources suggested udhcpc will pick-up the environment variable 'hostname' but that didn't work.

So I'm still stuck I'm afraid.
 
The hostname is set correctly on the "Network Configuration" page of the Webmin UI,
but it still isn't being sent as a DHCP option (#12 I believe) to the DHCP server.
Does this mean the hostname is correct but there is no hostname at all in the DHCP request? If so it's a problem of the container (and not any of Proxmox as such). Which template exactly did you use for creating the container?
 
As you say, the hostname is correct in the container, but isn't seen by the DHCP server (pfSense)
I used debian-10-turnkey-core_16.0-1_amd64.tar.gz
 
Last edited:
As you say, the hostname is correct in the container, but isn't seen by the DHCP server (pfSense)
I used debian-10-turnkey-core_16.0-1_amd64.tar.gz
Run

Code:
 apt install isc-dhcp-client

and the problem will not occur any more during the next reboot.
 
Success! That worked perfectly, thanks.
Does that mean there's no way to set the hostname option with the default DHCP client in the Debian template?
 
Does that mean there's no way to set the hostname option with the default DHCP client in the Debian template?
No - "turnkey-core" is only one kind of Debian template. You can create your own one easily by running "Convert to template" on an existing container which has installed all packages you need.
 
  • Like
Reactions: tony6227

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!