Mac address issue in sd820

Hi Team,

I am using an sd820 custom board with Atheros AR8151 PCI-E Gigabit Ethernet. I am using Debian operating system.
The ethernet mac address changes for every reboot. Is there any solution available to fix a permanent mac address?

Thanks,
Ajith.

most likely it’s because the Ethernet device is not provisioned with its MAC address. If you are using network-manager, you can configure it in such a way that the MAC address will be ‘stable’, e.g. always the same on the same device. We use this ‘trick’ in our DB845c builds, see:


and

Hi @ndec
Thanks for your response

I have tried the above solution. Still, the ethernet mac address changes during each boot. The same behaviour found in WIFI also.

So I have added the following lines in /etc/NetworkManager/NetworkManager.conf file

[device]
wifi.scan-rand-mac-address=no
ethernet.scan-rand-mac-address=no

Now WIFI doesn’t change mac address during each boot but ethernet changes the mac address.

Is there any other file that needs to be configured to fix the mac address?

Regards,
Ajith.

Are you using a Linaro release?

WiFi has normally a fixed MAC address, but it is possible that scanning use MAC randomization, for privacy reasons. If you connect to an AP, the regular MAC address should be used.

Regarding ethernet, Since there is no address provisioned, the current Ethernet driver (Atheros atl11c) sets a random address at each boot. systemd is supposed to detect that address is random because the net interface is flagged with NET_ADDR_RANDOM. In order to emulate a persistent MAC address, systemd overrides the random address with one generated from /etc/machine-id. This machine ID is usually generated from a random source during the first boot and is never changed, So you should get a constant MAC address for all subsequent boots… except if Network manager is configured to randomize ethernet addres as well, but it should be fixed by the trick @ndec pointed.