LXC. how to replace a long machine identifier with a mac address in dhcp

rusquad

Member
Feb 3, 2023
40
0
6
I'm using a container based on Ubuntu 23 and I want to receive the container's mac address instead of the identifier in the dhcp. how to force them to give away mac address? netplan configs do not affect the operation of the network. the config in networkd is overwritten by pve.
and one more thing, I don’t even receive the machine identifier in dhcp, instead there is a completely different identifier. I couldn't find it

cat /etc/machine-id
fa30f8de02224aee879d72b14e8d09db

after reboot or
networkctl renew eth0
1699102304499.png

even after re-creating the dbus-uuidgen ID --ensure=/etc/machine-id, there is a completely different identifier in dhcp again
 
Last edited:
Hi,
the machine id should never be sent out into the network, only derivatives like you are probably seeing [0].
You can configure your machine to send out a hardware based identifier [1], but I haven't tried that myself.

Regarding the overwritten config, this behavior can be changed by creating /etc/network/.pve-ignore.interfaces.

[0] https://www.freedesktop.org/software/systemd/man/latest/machine-id.html
[1] https://superuser.com/questions/1553094/force-to-use-mac-address-as-dhcp-client-id-on-debian-buster
 
  • Like
Reactions: rusquad

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!