I have a headless ARM server running 20.04.4, which for reasons I cannot understand has all it's NICs with hardware macs of all zeros, and sets the current mac randomly on every reboot.
╰─ macchanger eth2
Current MAC: 2a:77:19:7c:b4:e4 (unknown)
Permanent MAC: 00:00:00:00:00:00 (XEROX CORPORATION)
I run a pi hole on my network and it also handles the DHCP service, and can only assign static IPs based on reported mac address. This means that my server gets a new IP address on every reboot, which is problematic when there is an issue with the pi hole.
I want my server to keep a mac address for a given interface even when reboots happen.
I've tried
ip link set eth2 address 2A:77:19:7C:B4:E4
but that got wiped during a reboot.
I've tried using a link file with systemd-networkd, but this appears to have no effect either.
sudo nano /etc/systemd/network/10-eth2.link
[Match]
PermanentMACAddress=00:00:00:00:00:00
[Link]
MACAddress=2A:77:19:7C:B4:E4
Digging around, I found these log entries in
journalctl -b -u systemd-udevd.service
eth2: Could not generate persistent MAC: No data available
Feb 25 23:23:42 macchiatobin systemd-udevd[480]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.
How else can I set my mac address to the same value permanently, or on start up so it is the same value on every boot?