Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion with mac addresses #5

Open
visicon-masc opened this issue Aug 9, 2024 · 1 comment
Open

Confusion with mac addresses #5

visicon-masc opened this issue Aug 9, 2024 · 1 comment

Comments

@visicon-masc
Copy link

Hi!

First, thanks for your excellent work! 💪

I have a problem with the mac addresses of the R6C. I have multiple R6C and found out, that they use the same mac address. I use the same debian image for both devices (cloned by dd).

I’m not sure, but I think the R6C does not provide a physical mac address, stored on some eeprom, right? Is it defined in the device tree? I haven’t found the script that generates the mac address…

Main question: How could I change the mac address in a proper way? Defining a mac address in /etc/network/interfaces seems to be too late in some scenarios (firewall).

My goal is to clone a master image and change the mac address by some script.

Any help is highly appreciated! Thanks in advance!

Bye, Marc. 🖖

@inindev
Copy link
Owner

inindev commented Aug 29, 2024

Sorry for the late reply. The solution I use for this is to create configuration files for each device:

ls -al /etc/systemd/network
total 12
-rw-r--r-- 1 root root 100 Jun 16 05:44 10-name-lan1.link
-rw-r--r-- 1 root root 100 Jun 16 05:44 10-name-lan2.link
-rw-r--r-- 1 root root  86 Jun 16 05:44 10-name-wan0.link

inside the file you provide over-rides for the matching interface:

[Match]
Path=platform-3c0000000.pcie-pci-0000:01:00.0
[Link]
Name=lan1
MACAddress=01:23:45:67:89:ab

use udevadm to get the match values for your nics:

udevadm info /sys/class/net/* | grep 'ID_PATH='
E: ID_PATH=platform-3c0000000.pcie-pci-0000:01:00.0
E: ID_PATH=platform-3c0400000.pcie-pci-0001:01:00.0
E: ID_PATH=platform-fe2a0000.ethernet

(the devices above are for the r5s)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants