Background:
We have a multi-dragonboard system implementing PoE Mezzanines where it would be very nice if the DB units had persistent MAC addresses. It’s understood that the PoE Mez does not have hardware for a non-volatile MAC, so we handle it in software. A random (non-OEM conforming) address is fine since the units operate on a closed network so long as the addresses persist on each board (it doesn’t randomize on reboot or reconnect).
Problem:
The default method of generating the MAC is such that the value does not persist across cold reboots forcing our DHCP server to issue a new IP each time. While NetworkManager is supposed to support generating a MAC based on some device specific values (see assigned-mac-address
here), altering the the NM profile to implement this simply causes NM to generate a new profile on reboot and use that instead. How cheeky.
To complicate matters the solution must be implemented via configs on the rootfs image, not after first boot which is why I’m attempting the NM method rather than something like macchanger. While running macchanger is not itself forbidden, I need a solution that runs on first boot and persists thereafter without interactive configuration. If a macchanger solution, bonus if the generated MAC had something to do with some device specific variable, increasing the odds of real uniqueness.
Some info:
$ uname -r && apt list network-manager
4.14.0-qcomlt-arm64
Listing... Done
network-manager/testing,now 1.14.6-2 arm64 [installed]
$ cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile
[ifupdown]
managed=false
[logging]
level=TRACE
$ cat /etc/NetworkManager/conf.d/00-macfix.conf
[device]
wifi.scan-rand-mac-address=no
ethernet.assigned-mac-address=stable
[connection]
connection.stable-id=${CONNECTION}-${DEVICE}
$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
/etc/network/interfaces.d/
is empty.
TIA!