![]() |
|
Rock64: MAC Address is NOT Unique! - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4) +--- Forum: Pine A64 Hardware, Accessories and POT (https://forum.pine64.org/forumdisplay.php?fid=32) +---- Forum: Ethernet Port (https://forum.pine64.org/forumdisplay.php?fid=39) +---- Thread: Rock64: MAC Address is NOT Unique! (/showthread.php?tid=12889) |
Rock64: MAC Address is NOT Unique! - PDXpi - 01-24-2021 I have two Rock64 boards:
So I started digging around. And I found that... I'm not able to find the first 3 octets (86:e0:c0) in any OUI databases. But the kernel ring buffer had these entries... Code: e1000e: Intel(R) PRO/1000 Network Driver
e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
igb: Intel(R) Gigabit Ethernet Network Driver
igb: Copyright (c) 2007-2014 Intel Corporation.
igbvf: Intel(R) Gigabit Virtual Function Network Driver...and... Code: RTL8211F Gigabit Ethernet stmmac-0:00: attached PHY driver [RTL8211F Gigabit Ethernet] (mii_bus:phy_addr=stmmac-0:00, irq=POLL)
RTL8211F Gigabit Ethernet stmmac-0:01: attached PHY driver [RTL8211F Gigabit Ethernet] (mii_bus:phy_addr=stmmac-0:01, irq=POLL)To state the obvious:
Code: dietpi@DietPi:~$ grep addr /boot/armbianEnv.txt
ethaddr=00:06:dc:00:00:01
mac_addr=00:06:dc:00:00:01
dietpi@DietPi:~$ ip add | grep ether | awk '{ print $2 }'
86:e0:c0:ea:fa:a9
dietpi@DietPi:~$ cat /proc/cmdline
root=UUID=1542112e-4bd9-4f4a-9660-e9405c792736 rootwait rootfstype=ext4 consoleblank=0 loglevel=4 ubootpart=72193746-01 usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u
dietpi@DietPi:~$ sudo dmesg | grep 'Kernel command line' | sed 's/\[.*\] //'
Kernel command line: root=UUID=1542112e-4bd9-4f4a-9660-e9405c792736 rootwait rootfstype=ext4 consoleblank=0 loglevel=4 ubootpart=72193746-01 usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u
RE: Rock64: MAC Address is NOT Unique! - as365n4 - 01-25-2021 You need to spoof the MAC address when you have more than one on your network. It seems the MAC address is not physically burned onto a chip or something, but is created by the Operating System and changes with Linux flavour (Arch is different than Debian for instance) create /etc/systemd/network/00-default.link like below Code: [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 pathThis will overwrite the system settings at each boot and works fine on Arch and Debian. RE: Rock64: MAC Address is NOT Unique! - PDXpi - 01-25-2021 (01-25-2021, 09:42 AM)as365n4 Wrote: create /etc/systemd/network/00-default.link like below FIRST: I removed the previous entries from /boot/armbianEnv.txt... Code: dietpi@DietPi:~$ cat /boot/armbianEnv.txt
verbosity=4
bootlogo=false
overlay_prefix=rockchip
rootdev=UUID=1542112e-4bd9-4f4a-9660-e9405c792736
rootfstype=ext4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
docker_optimizations=off
console=noneSECOND: I created the /etc/systemd/network/00-default.link file and entered the five lines of configuration into it: Code: dietpi@DietPi:~$ ls -l /etc/systemd/network/
total 4
-rw-r--r-- 1 root root 118 Jan 25 16:26 00-default.link
lrwxrwxrwx 1 root root 9 Dec 16 07:48 99-default.link -> /dev/null
dietpi@DietPi:~$ cat /etc/systemd/network/00-default.link
[Match]
MACAddress=86:e0:c0:ea:fa:a9
[Link]
MACAddress=00:06:dc:00:00:01
NamePolicy=kernel database onboard slot pathTHIRD: I rebooted the Rock64. But the MAC address persists, unchanged: Code: dietpi@DietPi:~$ ip add | grep ether | awk '{ print $2 }'
86:e0:c0:ea:fa:a9Is there something more that I need to do? e.g., Perhaps remove /etc/systemd/network/99-default.link? TIA! RE: Rock64: MAC Address is NOT Unique! - PDXpi - 02-01-2021 UPDATE Over on the DietPi forum: Michalng provided a couple of feasible solutions to this. This is the one that I selected... Code: root@DietPi:~# mv /etc/udev/rules.d/80-net-setup-link.rules /tmp
root@DietPi:~# 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.rulesAnd it seems to have worked as expected: Code: root@DietPi:~# cat /etc/udev/rules.d/99-eth0-mac.rules
SUBSYSTEM=="net", KERNEL=="eth0", ACTION=="add", RUN+="ip l set dev eth0 address 00:06:dc:00:00:01"
root@DietPi:~# reboot
dietpi@DietPi:~$ ip address show eth0 | grep ether
link/ether 00:06:dc:00:00:01 brd ff:ff:ff:ff:ff:ffHTH somebody! |