Welcome! Log In Create A New Profile

Advanced

Pogoplug-Pro-V1 Oxnas (OX820) Debian changing MAC-address

Posted by chaos 
Pogoplug-Pro-V1 Oxnas (OX820) Debian changing MAC-address
March 23, 2022 04:43PM
Curiosity in these privacy times made me wonder how Pogoplug-Pro-V1 (with latest kernel 5.4.179) could be made to change MAC-address to a random hardware address under Debian. Curiosity made me see that this already seems to be built into the rootfs, or am I mistaken? This has been observed by chance:

arp-scan -l
192.168.0.4	00:11:22:33:44:55	Cloud Engines, Inc.

a minute later...

arp-scan -l
192.168.0.2	44:55:00:11:aa:22	(Unknown: locally administered)

How is the MAC-address made to change in this way, and what controls it in Debian?
How can the
(Unknown: locally administered)
be changed or manipulated?
Re: Pogoplug-Pro-V1 Oxnas (OX820) Debian changing MAC-address
March 23, 2022 06:17PM
chaos,

> Curiosity in these privacy times made me wonder
> how Pogoplug-Pro-V1 (with latest kernel 5.4.179)
> could be made to change MAC-address to a random
> hardware address under Debian. Curiosity made me
> see that this already seems to be built into the
> rootfs, or am I mistaken?

The kernel behavior regarding MAC address changed a few years ago. It was in the DTS. I am not aware that this OXNAS SoC was also affected by that (the Kirkwood kernel was not). I guess there must have been some ripple effect in the DTS dependencies (i.e. *.dtsi).

>
> arp-scan -l
> 192.168.0.4	00:11:22:33:44:55	Cloud Engines, Inc.
>
>
> a minute later...


That is the real MAC address, probably was u-boot netconsole. Do you have netconsole activated? or did some tftp or dhcp during booting?

>
> arp-scan -l
> 192.168.0.2	44:55:00:11:aa:22	(Unknown: locally
> administered)
>

Now when the kernel boots, it got triggered by the logic in the DTS to assigned a random local MAC address.

My released MVEBU rootfs has a script that got invoked by /etc/rc.local.

Quote
https://forum.doozan.com/read.php?2,32146

Note 6 (Optional):

To enable the network dynamic IP to stay consistent after each reboot, and also for faster boot. In this rootfs, a script is executed during kernel booting (in /etc/rc.local), to detect if a local MAC address was assigned during boot, and then set the persistent MAC address to what is currently defined in u-boot env ethaddr.

/root/set_persistent_mac_address

To keep using the kernel generated local MAC address (if local MAC address was generated in your box) then remove or rename this script.

I've attached it to this post. So you can use it in the meantime.

==============

I'll take a look at this DTS file to see if I can see why.

-bodhi
===========================
Forum Wiki
bodhi's corner
Attachments:
open | download - set_persistent_mac_address (814 bytes)
Re: Pogoplug-Pro-V1 Oxnas (OX820) Debian changing MAC-address
March 23, 2022 06:28PM
And note that if you want to use you own random MAC address (that is generated once) with the script set_persistent_mac_address, then in Debian,

fw_setenv ethaddr random-MAC-address

This way it will always use that MAC address and you will never expose your real MAC address.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Pogoplug-Pro-V1 Oxnas (OX820) Debian changing MAC-address
March 24, 2022 04:18PM
> I'll take a look at this DTS file to see if I can
> see why.

Yes. The MAC address behavior change was in sometime before kernel 5.4.x.

root@tldDebian:/usr/src/linux-4.14.222-oxnas/arch/arm/boot/dts# diff ox820.dtsi /usr/src/linux-5.4.101-oxnas/arch/arm/boot/dts/ | grep mac

> 			mac-address = [000000000000]; /* Filled in by U-Boot */

That was the reason the MAC address was randomly generated by the kernel.

-bodhi
===========================
Forum Wiki
bodhi's corner
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: