Welcome! Log In Create A New Profile

Advanced

Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3

Posted by schnee 
Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 02, 2020 06:36PM
Hi,

i just installed the new kernel on my V3 classic box and have some issues with the MAC address.

I have the uboot env setup for the MAC address:
root@sch~# uname -r
4.14.176-oxnas-tld-1
root@sch:~# fw_printenv
...
dtb_file=/boot/dts/ox820-pogoplug-classic.dtb
ethact=dwmac.40400000
ethaddr=52:3b:20:9c:XX:XX
...

However when it boots the kernel uses a different MAC address:
root@schcamus:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ....
        ether 62:4a:a7:bb:YY:YY  txqueuelen 1000  (Ethernet)
        .....

Any idea what can cause this problem?

Note: everything else seems to work fine as usually.

thanks



Edited 1 time(s). Last edit at 05/02/2020 06:39PM by schnee.
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 02, 2020 08:06PM
schnee,


That's OK. The MAC address 52:3b:20:9c:XX:XX is a random local MAC that I coded in u-boot envs to help with installation process. It is not your real MAC address. You would have to set the env ethaddr to the correct one for your box.

The MAC address 62:4a:a7:bb:YY:YY looks like another random MAC address assigned by the kernel.

So look in you dmesg and see if it was assigned during boot.

====

I might have to correct the DTS to make it not doing that. The ethaddr should be used.

In previous kernel versions, I made sure that it will not generate random MAC. It seems I've let this fall through the crack :)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 02, 2020 10:51PM
Thanks bodhi!

I do remember changing the ethaddr variable during the installation ~1 year ago, but i could be wrong. Anyway i don't have the case with the sticker so i have no idea what was the original MAC for this box. Is there any way to figure it out?

With the 4.4.X kernel version this MAC address worked fine. You mentioned that you may have to fix this in DTS, so i feel that currently it does not matter what MAC address i use in uboot, the kernel will generate it's own?

Here is some info from dmesg:
[    3.767057] stmmac - user ID: 0x12, Synopsys ID: 0x35
[    3.772096] oxnas-dwmac 40400000.ethernet: Ring mode enabled
[    3.777784] oxnas-dwmac 40400000.ethernet: DMA HW capability register supported
[    3.785062] oxnas-dwmac 40400000.ethernet: Enhanced/Alternate descriptors
[    3.791846] oxnas-dwmac 40400000.ethernet: Enabled extended descriptors
[    3.798461] oxnas-dwmac 40400000.ethernet: RX Checksum Offload Engine supported
[    3.805742] oxnas-dwmac 40400000.ethernet: COE Type 2
[    3.810795] oxnas-dwmac 40400000.ethernet: TX Checksum insertion supported
[    3.817671] oxnas-dwmac 40400000.ethernet: Wake-Up On Lan supported
[    3.823938] oxnas-dwmac 40400000.ethernet (unnamed net_device) (uninitialized): device MAC address 62:4a:a7:bb:YY:YY
[    3.834452] oxnas-dwmac 40400000.ethernet: Enable RX Mitigation via HW Watchdog Timer


Thanks

Schnee
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 03, 2020 05:00AM
schnee,

> Anyway i don't have the case with the
> sticker so i have no idea what was the original
> MAC for this box. Is there any way to figure it
> out?

In u-boot, hopefully it is still the original in the NIC memory:

bdinfo

> [ 3.823938] oxnas-dwmac 40400000.ethernet
> (unnamed net_device) (uninitialized): device MAC
> address 62:4a:a7:bb:YY:YY

That's what I meant above, 62:4a:a7:bb is a local MAC address randomly generated by the kernel. We don't want that.

So I will look at the DTS source again to see if I can change it back the way it was in 4.4. If not, we can use a workaround script that I wrote for the MVEBU boxes.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 03, 2020 10:17AM
bodhi,

i checked bdinfo in uboot and the MAC address is the same what is in the env variables
ethaddr 52:3b:20:9c:11:51

If i remove the ethaddr variable and reboot the board the MAC address remains empty.

Unfortunately i got this board without the case and with modified firmware with the above MAC. i have no idea how to recover the Cloud Engine assigned MAC address. Anyway, i think i have to wait for your DTS update, before i can fix this

Thanks

Schnee
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 03, 2020 02:51PM
Sorry to jump in on this but I thought I was hacked as I was experiencing the same thing on my 2 Pogoplug Pro boxes. I went back to the previous release and all is well now. No matter what I tried I couldn't get them to keep the correct MAC address. I ended up messing one up so bad I just reinstalled everything, but not doing the latest release.



Edited 1 time(s). Last edit at 05/03/2020 03:01PM by bluzfanmr1.
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 03, 2020 03:49PM
bluzfanmr1,

> Sorry to jump in on this but I thought I was
> hacked as I was experiencing the same thing on my
> 2 Pogoplug Pro boxes. I went back to the previous
> release and all is well now.

Sorry for the false alarm :) The default behavior of Linux kernel is now to generate a local MAC address. But we will make it so the MAC is the real one.

You could have add the MAC address to /etc/network/interfaces to keep it persistent, too. No need to go back to the previous version. For example,

cat /etc/network/interfaces

iface eth0 inet static
        address 192.168.0.236
        netmask 255.255.255.0
        gateway 192.168.0.1
       hwaddress ether 60:31:xx:xx:1xx:xx

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 03, 2020 04:11PM
bodhi,

Thank you for the fix, I appreciate it. I remember now seeing that but by that time I had decided to start over. I will upgrade to the latest and do as you advise.

FYI, I have been following this forum for years but never signed up until recently. I have learned so much from here and especially from you. Around 2010 or so I had a couple of dead Pogoplug's from when they still worked with the Pogoplug service. In trying to figure out how to get them to work again, I ran across this forum and couldn't believe all the things that could be done by hacking them. It's been a lot of fun and a valuable tool for me to learn about Linux. i just wanted to thank you for all the great info and I greatly appreciate you sharing all your knowledge with everyone.
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 03, 2020 04:23PM
bluzfanmr1,

My pleasure! glad you have finally registered and joined us. If you think you can add something new to the Wiki thread, does not matter if it is simple or complicate, please post.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 07, 2020 01:55PM
bodhi,

I did as you suggested and added the hwaddress ether to /etc/network/interfaces but it isn't working. Anything else I can try?

Can you explain the reason for the new default behavior for this? Why would one wish to use a random mac address instead of the real one?

Thanks again!
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 07, 2020 03:17PM
bluzfanmr1 ,

this is how i added and it works fine:
auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp
	hwaddress ether 52:3b:20:XX:XX:XX

Schnee
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 07, 2020 04:21PM
Schnee,

Thanks for your reply. Here is what I have and it doesn't seem to work:

auto lo eth0
iface lo inet loopback
iface eth0 inet static
	address 10.1.1.197
	netmask 255.255.255.0
	broadcast 10.1.1.255
	network 10.1.1.0
	gateway 10.1.1.1
	hwaddress ether 00:25:31:xx:xx:xx

Is there anythere here that looks wrong? Could I possibly have something else messed up? This is happening on both of my Pogoplug Pro's but not on my E02 or Mobile, as I know they run different stuff.
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 07, 2020 04:41PM
I looked at the man page and was unable to find the network option you are using (but could be wrong).

Do you see anything in dmesg?

Schnee
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 07, 2020 05:01PM
bluzfanmr1,

auto lo eth0
iface lo inet loopback
iface eth0 inet static
	address 10.1.1.197
	netmask 255.255.255.0
	gateway 10.1.1.1
	hwaddress ether 00:25:31:xx:xx:xx

gateway IP should be your router.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 07, 2020 05:56PM
All,

Let me post a nicer way to set your MAC address.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 07, 2020 07:01PM
The attached script was included in the rootfs for MVEBU boxes.

So now that we are seeing the same problem, I will need to add this to the OXNAS boxes installation instruction.

Quote

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.

So if you don't want to remember to change the hardcoded MAC in /etc/network/interfaces when you use this rootfs on another box (in case you have multiple Pogo OXNAS boxes), you can put this script in /root folder. And then modify your /etc/rc.local:

The content of /etc/rc.local
#!/bin/sh -e 
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.


# Set MAC to the real one for this box
/root/set_persistent_mac_address

....

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Attachments:
open | download - set_persistent_mac_address (814 bytes)
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 08, 2020 04:52PM
I've fixed the DTS so that it will use u-boot passed MAC address, and not generating a local random MAC address during boot.

Attached is the new DTB tarball.

Quote

dts/ox820-stg212.dtb
dts/ox820-pogoplug-pro.dtb
dts/ox820-akitio.dtb
dts/ox820-kd20.dtb
dts/ox820-pogoplug-classic.dtb

All OX820 boxes should update the DTB with this tarball.

Please remove all workaround to make the MAC address persistent (as mentioned in previous posts). And then extract the new DTBs.

cd /boot
tar xf  linux-dtb-4.14.176-oxnas-tld-2.tar

And reboot.

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



Edited 1 time(s). Last edit at 05/08/2020 05:10PM by bodhi.
Attachments:
open | download - linux-dtb-4.14.176-oxnas-tld-2.tar (60 KB)
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 08, 2020 05:21PM
bodhi,

I just updated one of my boxes and it works perfectly! Thanks for your help!

Also, could you educate a Linux amateur as to examples where a random MAC address would be preferable? I read about it but haven't been able to wrap my head around it.

Thanks again.



Edited 1 time(s). Last edit at 05/08/2020 05:21PM by bluzfanmr1.
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 08, 2020 06:46PM
bluzfanmr1,

It is useful for locally administered networks in many scenarios. Let's consider a couple.

- If you have many VMs that run on a server or a laptop, each can have different a randomly generated local MAC address.

- If you have a real computer or a VM that is facing the internet. And you don't want to leak the real MAC address, you would use a local MAC address which is genenerated randomly. Your computer signature would be IP address, MAC address, clock time, etc (even something like mouse movement could be part of the signature tracked by sophisticate algorithms).

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



Edited 1 time(s). Last edit at 05/08/2020 06:47PM by bodhi.
Re: Ethernet problem with Linux Kernel 4.14.176 Oxnas (OX820) Pogo V3
May 09, 2020 07:59AM
bodhi,

thank you for the quick fix. It works perfectly on my box.

Schnee
Author:

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: