I’ve installed DietPi 6.34.3 on both boards. But I’m not able to connect both to the same L2 broadcast domain at the same time because each board has the same MAC address (86:e0:c0:ea:fa:a9)!
ethaddr=36:c9:e3:f1:b8:01 <--- your desired address
mac_addr=36:c9:e3:f1:b8:01 <--- your desired address
Configure the MAC address in /etc/systemd/network/00-default.link:
[Match]
MACAddress=da:19:c8:7a:6d:f4 <--- whatever your original address is
[Link]
MACAddress=da:19:c8:7a:6d:f5 <--- your desired address
NamePolicy=kernel database onboard slot path
But neither answer is effective! i.e., The MAC addresses of each board remain unchanged.
So I’ll ask the question here, in the forum for discussing the DietPi O/S instead of the forum for disussing the H/W:
When using DietPi as the O/S: Is it possible to manually configure the MAC address of the Gigabit Ethernet interface on the Rock64?
DietPi themselves did not offer something like this on the DietPi gui. DietPi is not an own OS, it’s a set of scripts on top of a base image. I guess solution would need to be provided on this layer.
I’m not 100% sure but I guess Rock64 is using Armbian as base image (should be visible on the header after you login). So it would be a behaviour of Armbian. And probably on an Armbian forum you will have more knowledgeable people on this
I had only specified that some Ethernet interface should be configured - And I had not specified which Ethernet interface should be configured (i.e., ethX) So I added that bit…
eth0addr is not valid: https://www.denx.de/wiki/view/DULG/UBootEnvVariables
So with the single onboard Ethernet adapter, respectively for eth0, ethaddr is correct. Not sure why it has no effect on Armbian ROCK64 currently .
Alternatively, ifupdown can assign the MAC address when the interface is brought up:
hwaddress ether 00:06:dc:00:00:01
Add this to /etc/network/interfaces, the eth0 block.
A udev rule could do it earlier on boot, if required, using:
ip l set dev eth0 address 00:06:dc:00:00:01
echo 'SUBSYSTEM=="net", KERNEL=="eth0", ACTION=="add", RUN+="ip l set dev eth0 address 00:06:dc:00:00:01"' > /etc/udev/rules.d/99-eth0-mac.rules
We should implement this feature into dietpi-config, so allow both: Assigning a custom static MAC address and assigning a random new MAC at boot. It looks like the U-Boot options differs too much across different boards, bootloaders and kernels, so that it would be not always functional or mess of trail & errors to get it right for each board and then maintain those individual methods .