This question already has an answer here:
I need to alter the MAC address for eth1 ethernet device on my embedded system permanently so it retains this MAC address on every boot.
The OS I'm using:
VERSION_ID="v2015.12" NAME="Angstrom" ID="angstrom" PRETTY_NAME="The Ångström Distribution v2015.12" ANSI_COLOR="1;35" HOME_URL="http://www.angstrom-distribution.org"
The version of Linux I am using is:
Linux arria10 4.1.33-ltsi-altera #1 SMP Mon Oct 30 10:14:22 PDT 2017 armv7l GNU/Linux
I am able to set the MAC address for eth0 by altering the following bootarg:
setenv ethaddr 00:11:22:33:44:55 save run bootcmd
Once booted, eth0 takes this MAC address as expected.
When I try to do the same for eth1, using
eth1addr a random MAC address is defined when I boot.
I can however alter the MAC address of eth1 once booted by using the following:
ifconfig eth1 down ifconfig eth1 hw ether 00:11:22:33:44:56 ifconfig eth1 up
This is not a permanent solution for me as I would need to set the MAC every time I have booted the device.
Is there a way to set the MAC address of eth1 from the bootargs? Also any ideas on why I wouldn't be able to set the MAC address using
eth0 is RGMII, eth1 is SGMII