I am working on a platform with an ARM CPU running linux that has a single MAC in the CPU directly connected to a switch IC. I am trying to set up a VLAN mode using systemd-networkd which I have done successfully. However, the MAC addresses for the created VLAN ports are random and that is not ideal. Using MACAddressPolicy=persist in the relevant .link file I do have a persistent MAC address though each boot however the MAC address it grabbed was random.
However, the CPU is assigned two MAC addresses. What I am looking to do is find the first MAC address it is assigned (which is set to the eth0 device), assign that MAC to eth0.1, and then assign that MAC +1 to eth0.2 Is there an easy way to do this through systemd-networkd or udev? I also need a setup that can be put on to thousands of the completed devices and have systemd-netorkd automatically handle everything, rather than modifying the .network files on each unit.