Pogo Plug V3 Kernel 5.15.158 Oxnas ethernet address
September 24, 2024 08:10AM
Hi,

I just created a clean install on a Pogo Plug V3 with the latest rootfs Kernel 5.15.158 Oxnas.

After finishing the install and booting I see that is it using MAC address 5a:ea:2e:cb:XX:XX on my network, while there is a different MAC address set in uboot envs:

dtb_file=/boot/dts/ox820-pogoplug-pro.dtb
ethact=dwmac.40400000
ethaddr=00:25:31:01:XX:XX

It was long time ago I made a clean install so it could be that I missed a step somewhere, but I am unable to figure out what causing the issue.

Any help would be appreciated!

Thanks

Schnee
Re: Pogo Plug V3 Kernel 5.15.158 Oxnas ethernet address
September 24, 2024 01:11PM
Hi Schnee,

> After finishing the install and booting I see that
> is it using MAC address 5a:ea:2e:cb:XX:XX on my
> network, while there is a different MAC address
> set in uboot envs:
>
>
> dtb_file=/boot/dts/ox820-pogoplug-pro.dtb
> ethact=dwmac.40400000
> ethaddr=00:25:31:01:XX:XX
>

Look in dmesg. See if the MAC address is a local MAC address randomly generated by the kernel. The address 5a:ea:2e:cb:XX:XX is a local MAC address (it starts with 5a:). The MAC address 00:25:31:01:XX:XX is real one that was set by you explicitly during u-boot installation.
dmesg
ifconfig -a

Recent Linux kernels generate a random local MAC when it does not find the hardware MAC address passed in from u-boot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Pogo Plug V3 Kernel 5.15.158 Oxnas ethernet address
September 26, 2024 01:19AM
Thanks Bodhi!

I already checked demsg and i don't see the used MAC address there. Here is the relevatnt section and it has mac address d6:89:3f:37:68:9f :
[    7.660249] oxnas-dwmac 40400000.ethernet: IRQ eth_lpi not found
[    7.667133] oxnas-dwmac 40400000.ethernet: PTP uses main clock
[    7.741002] oxnas-dwmac 40400000.ethernet: User ID: 0x12, Synopsys ID: 0x35
[    7.748661] oxnas-dwmac 40400000.ethernet: 	DWMAC1000
[    7.754516] oxnas-dwmac 40400000.ethernet: DMA HW capability register supported
[    7.762536] oxnas-dwmac 40400000.ethernet: RX Checksum Offload Engine supported
[    7.770542] oxnas-dwmac 40400000.ethernet: COE Type 2
[    7.776271] oxnas-dwmac 40400000.ethernet: TX Checksum insertion supported
[    7.783841] oxnas-dwmac 40400000.ethernet: Wake-Up On Lan supported
[    7.790804] oxnas-dwmac 40400000.ethernet: Enhanced/Alternate descriptors
[    7.798259] oxnas-dwmac 40400000.ethernet: Enabled extended descriptors
[    7.805598] oxnas-dwmac 40400000.ethernet: Ring mode enabled
[    7.811965] oxnas-dwmac 40400000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[    7.820518] oxnas-dwmac 40400000.ethernet: device MAC address d6:89:3f:37:68:9f

However ip a shows 5a:ea:2e:cb:64:fd as mac address
root@debian:/# ip a
...
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 5a:ea:2e:cb:64:fd brd ff:ff:ff:ff:ff:ff
    inet 192.168.3.217/23 brd 192.168.3.255 scope global dynamic eth0
       valid_lft 515sec preferred_lft 515sec
    inet6 fe80::58ea:2eff:fecb:64fd/64 scope link 
       valid_lft forever preferred_lft forever

In uboot i set 00:25:31:01:c1:ba
root@debian:/# fw_printenv ethaddr
ethaddr=00:25:31:01:c1:ba

Probably I can force the 00:25 mac address via the interfaces file, but I think it should read it from uboot envirtonment.

Thanks

Schnee
Re: Pogo Plug V3 Kernel 5.15.158 Oxnas ethernet address
September 26, 2024 01:52PM
Schnee,

> [ 7.820518] oxnas-dwmac 40400000.ethernet:
> device MAC address d6:89:3f:37:68:9f

That's the local MAC address generated by the driver.

> However ip a shows 5a:ea:2e:cb:64:fd as mac
> address

This is also a local MAC address. My guess is that the router remembers this MAC address. When you change MAC address, some router takes a long time to clear out the old one.

> Probably I can force the 00:25 mac address via the
> interfaces file, but I think it should read it
> from uboot envirtonment.

For some MVEBU Armada boards, the hardware MAC address is not populated by its stock u-boot, so I have a work around. This script will use the MAC address in u-boot env.

See the release thread:

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

Quote

Updated 16 Dec 2023:

Rootfs Debian-6.6.2-mvebu-tld-1-rootfs-bodhi.tar.bz2 has been uploaded.

Basic Debian bookworm armhf rootfs for most MVEBU Armada NAS:

......

Note 6. Persistent MAC address (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 chmod this script to non-executable.
chmod -x /root/set_persistent_mac_address

Further improvement: after releasing this rootfs, I realized I've forgot to implement an improvement for this. Please see here for more info.

I've attached the script to this post.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 09/26/2024 01:53PM by bodhi.
Attachments:
open | download - set_persistent_mac_address (857 bytes)
Re: Pogo Plug V3 Kernel 5.15.158 Oxnas ethernet address
September 26, 2024 02:37PM
Thanks, i will try the script!

A few comments:

> > However ip a shows 5a:ea:2e:cb:64:fd as mac
> > address
>
> This is also a local MAC address. My guess is that
> the router remembers this MAC address. When you
> change MAC address, some router takes a long time
> to clear out the old one.

This the mac address I see on the board (not on the router) when running 'ip a' command. It i weird that during boot it generates a mac address and the uses another when actually connecting to teh network.

>
> > Probably I can force the 00:25 mac address via
> the
> > interfaces file, but I think it should read it
> > from uboot envirtonment.
>
> For some MVEBU Armada boards, the hardware MAC
> address is not populated by its stock u-boot, so I
> have a work around. This script will use the MAC
> address in u-boot env.
>

This is a PogoPlug V3 Pro board.

Schnee
Re: Pogo Plug V3 Kernel 5.15.158 Oxnas ethernet address
September 26, 2024 03:04PM
Schnee,

> This the mac address I see on the board (not on
> the router) when running 'ip a' command. It i
> weird that during boot it generates a mac address
> and the uses another when actually connecting to
> teh network.

I know. It seems as though the router still has the record for this IP address and its MAC, so it's use the old one, instead of using the new one in the request. If you use static IP, it's more likely you'll experience this problem (because the dynamic IP will be de-registered whenever you shut down, but not static IP).

Long ago, I had similar issue and looked at my router settings and noticed that, for a period of time, it kept the record for a box that is no longer in the network. So it was just a guess, I can't prove it, though. If you want to get to the bottom of this, shut down the Pogo and look in the router web page to see how long you will see it remains in the router.

> This is a PogoPlug V3 Pro board.

Yes. It seems the MAC address part of the driver is common to all boards in the Linux kernel.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Pogo Plug V3 Kernel 5.15.158 Oxnas ethernet address
September 28, 2024 06:24PM
I added the script to my box and as a result after every boot I have to login on the serial console to restart teh ssh server. Otherwise it is not possible to log on remotely via ssh.

In dmesg I still see that the ethenet adapter gets a different mac address before the script assings the mac address from u-boor env:
[    7.638389] oxnas-dwmac 40400000.ethernet: IRQ eth_lpi not found
[    7.645271] oxnas-dwmac 40400000.ethernet: PTP uses main clock
[    7.719068] oxnas-dwmac 40400000.ethernet: User ID: 0x12, Synopsys ID: 0x35
[    7.726735] oxnas-dwmac 40400000.ethernet: 	DWMAC1000
[    7.732523] oxnas-dwmac 40400000.ethernet: DMA HW capability register supported
[    7.740538] oxnas-dwmac 40400000.ethernet: RX Checksum Offload Engine supported
[    7.748546] oxnas-dwmac 40400000.ethernet: COE Type 2
[    7.754275] oxnas-dwmac 40400000.ethernet: TX Checksum insertion supported
[    7.761850] oxnas-dwmac 40400000.ethernet: Wake-Up On Lan supported
[    7.768821] oxnas-dwmac 40400000.ethernet: Enhanced/Alternate descriptors
[    7.776276] oxnas-dwmac 40400000.ethernet: Enabled extended descriptors
[    7.783603] oxnas-dwmac 40400000.ethernet: Ring mode enabled
[    7.789975] oxnas-dwmac 40400000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[    7.798533] oxnas-dwmac 40400000.ethernet: device MAC address f6:7f:52:4d:ca:97
....
[   36.399918] Setting Persistent MAC address for eth0 to 00:25:31:01:c1:ba
[   36.567964] oxnas-dwmac 40400000.ethernet eth0: PHY [stmmac-0:00] driver [Generic PHY] (irq=POLL)
[   36.578370] oxnas-dwmac 40400000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
[   36.594534] oxnas-dwmac 40400000.ethernet eth0: No Safety Features support found
[   36.602721] oxnas-dwmac 40400000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[   36.612254] oxnas-dwmac 40400000.ethernet eth0: registered PTP clock
[   36.621383] oxnas-dwmac 40400000.ethernet eth0: configuring for phy/rgmii link mode
[   41.839605] oxnas-dwmac 40400000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx


I have anouthed pogoPlug V3 which has the same kernel and also on debian 12. It reads teh MAC address from u-boot without issues. The main difference is this box was not a clean install, but an upgrade. In this dmesg does not even mention the mac addrees:
[    7.610263] oxnas-dwmac 40400000.ethernet: IRQ eth_lpi not found
[    7.617180] oxnas-dwmac 40400000.ethernet: PTP uses main clock
[    7.687454] oxnas-dwmac 40400000.ethernet: User ID: 0x12, Synopsys ID: 0x35
[    7.695119] oxnas-dwmac 40400000.ethernet: 	DWMAC1000
[    7.700899] oxnas-dwmac 40400000.ethernet: DMA HW capability register supported
[    7.708904] oxnas-dwmac 40400000.ethernet: RX Checksum Offload Engine supported
[    7.716910] oxnas-dwmac 40400000.ethernet: COE Type 2
[    7.722644] oxnas-dwmac 40400000.ethernet: TX Checksum insertion supported
[    7.730211] oxnas-dwmac 40400000.ethernet: Wake-Up On Lan supported
[    7.737180] oxnas-dwmac 40400000.ethernet: Enhanced/Alternate descriptors
[    7.744634] oxnas-dwmac 40400000.ethernet: Enabled extended descriptors
[    7.751959] oxnas-dwmac 40400000.ethernet: Ring mode enabled
[    7.758333] oxnas-dwmac 40400000.ethernet: Enable RX Mitigation via HW Watchdog Timer
....
[   83.070748] oxnas-dwmac 40400000.ethernet end0: PHY [stmmac-0:00] driver [Generic PHY] (irq=POLL)
[   83.083819] oxnas-dwmac 40400000.ethernet end0: Register MEM_TYPE_PAGE_POOL RxQ-0
[   83.100003] oxnas-dwmac 40400000.ethernet end0: No Safety Features support found
[   83.108152] oxnas-dwmac 40400000.ethernet end0: IEEE 1588-2008 Advanced Timestamp supported
[   83.117662] oxnas-dwmac 40400000.ethernet end0: registered PTP clock
[   83.142154] oxnas-dwmac 40400000.ethernet end0: configuring for phy/rgmii link mode
[   86.317985] oxnas-dwmac 40400000.ethernet end0: Link is Up - 1Gbps/Full - flow control rx/tx

Schnee
Re: Pogo Plug V3 Kernel 5.15.158 Oxnas ethernet address
September 28, 2024 09:06PM
Schnee,

> In dmesg I still see that the ethenet adapter gets
> a different mac address before the script assings
> the mac address from u-boor env:

Yes. That's the expected behaviour. The kernel failed to find the MAC address the normal way (for ARM hardware), so it assigns a random local MAC address. The script then runs a bit later from /etc/rc.local will reset it using the u-boot env ethaddr.

> I added the script to my box and as a result after
> every boot I have to login on the serial console
> to restart teh ssh server. Otherwise it is not
> possible to log on remotely via ssh.

I'm guessing that you probably need to wait a bit for the router to update its settings. Also the Ethernet driver for this box is a pain to deal with.

If all else fails, I'll suggest an alternative work around.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
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: