Jump to content

Recommended Posts

Posted (edited)

I have installed Armbian on my Rock Pi S, done some setup, and then taken an image of the disk to be duplicated to other devices.
The problem is that each of these devices get the same permanent MAC address on the ethernet port as the first device. I don't know how Armbian gets the MAC address from the interface but it doesn't seem to depend on unique hardware, or if it does then the hardware ID isn't actually unique between boards.

This leads to problems because my device is meant to be used several in the same network, causing collisions in DHCP assignment etc.

 

I have tried multiple workarounds and none have worked well. I tried spoofing the MAC addr by changing the cloned-mac-address setting in NetworkManager. This worked at changing the MAC address, however it caused an entirely different problem, namely that a fallback connection with a link-local address never gets activated. It previously worked but after changing only this setting, it no longer works. I have no idea why but I have tried for days now to fix this issue and I'm out of new ideas.

 

The other thing I tried was adding ethaddr=[some mac address] in the armbianEnv.txt file, as found in another forum thread. This didn't seem to do anything, the same duplicate MAC address was still used.

 

I also tried using macchanger, but it was difficult to get to work nicely with NetworkManager, I don't think this is a good solution...

 

What else can I try?

Edited by grixm
  • Solution
Posted

For the record, I finally found a solution.

There is already a bash script in the rock pi s distribution that changes to a unique mac address. However for whatever reason this is not set up to run on the ethernet port, only on wifi. You can fix this by opening the file /etc/udev/rules.d/05-fixMACaddress.rules , adding this line:

KERNEL=="end0", ACTION=="add" RUN+="fixEtherAddr %k 06"

(Change end0 with eth0 on ubuntu version)

 

PS: Even this didn't seem to work on older armbian versions like v22, but on v24 debian build it worked.

Posted

@grixm you copied the image of the SD card after the initial setup?

 

I think that results in the same machine-id(/etc/machine-id) and as such I guess it could get the same MAC address?

 

I set the neplan MAC address in my netplan file. I think that is enough.

Posted

Verified that RockPi-S and Rock S0 build-in Ethernet MAC are derived from something in the image, rather than a unique hardware address.   The fix will be to make standard what @grixm has done, which will derive the MAC addresses of all the built-in network peripherals from the unique CPU serial number.  The built-in WiFi MAC was coming up different on each boot, which was obviously wrong and has already been fixed.

 

I'll submit a pull request shortly.  It should make into the next release.  Thanks for catching this.

Posted

More research showed that this was fixed in v2024.10 of U-Boot slated for the next RockPI-S armbian release.

[The current release uses the older v2022.04 U-Boot.]

When you see you are booting with v2024.10 U-Boot, you may remove the MAC fix for the built-in ethernet interface.  You will still need it for the WiFi, however.

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines