Firefly Open Source Community

Title: New MAC on eth0 on each reboot [Print This Page]

Author: da_rinkes    Time: 3/24/2017 03:42
Title: New MAC on eth0 on each reboot
I noticed the MAC and as result IP changes on each reboot.

Why is this and how to fix this?
Is the built in NIC missing an own MAC?

root@firefly:~# ifconfig
eth0      Link encap:Ethernet  HWaddr f2:79:9d:4d:a7:4c
          inet addr:192.168.178.59  Bcast:192.168.178.255  Mask:255.255.255.0
          inet6 addr: fe80::b640:dc58:86e8:e1b6/64 Scopeink
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2444 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1385 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3627283 (3.6 MB)  TX bytes:109095 (109.0 KB)
          Interrupt:24

<REBOOT>

root@firefly:~# ifconfig
eth0      Link encap:Ethernet  HWaddr e2:7c:20:f5:fd:1a
          inet addr:192.168.178.60  Bcast:192.168.178.255  Mask:255.255.255.0
          inet6 addr: fe80::2663:b79d:9d26:cb9d/64 Scopeink
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20 errors:0 dropped:0 overruns:0 frame:0
          TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7096 (7.0 KB)  TX bytes:6171 (6.1 KB)
          Interrupt:24
Author: isle    Time: 3/24/2017 09:36
Hi
check this  :  firefly-rk3399-android-sdk/RKDocs/RKTools manuals/WNpctool简要使用说明_V1.1.0_0920.pdf
Author: da_rinkes    Time: 3/24/2017 15:54
isle Posted at 3/24/2017 09:36
Hi
check this  :  firefly-rk3399-android-sdk/RKDocs/RKTools manuals/WNpctool简要使用说明_V1.1.0_09 ...

Where can I find this Document?

Looked at https://gitlab.com/TeeFirefly/FireNow-Marshmallow and google, but no result
Author: isle    Time: 3/24/2017 16:46
Oh,my bad, this document haven't been uploaded  ,
check this  : http://wiki.t-firefly.com/index. ... lash_MAC_address.3F
In Q9 of FAQs :

Author: da_rinkes    Time: 3/24/2017 17:17
Ok, I tried this already, but without success. MAC is written and can be read, but the linux kernel still comes up with a 00:00:00:00:00:00 on eth0. I will recheck then.

Currently using the Ubuntu 16.04 image from http://en.t-firefly.com/en/firenow/Firefly_RK3399/download/.
Maybe there is an issue with your kernel, so it can't find the MAC and fallbacks to generate random MACs each boot?
Author: da_rinkes    Time: 3/24/2017 20:57
Cannot make it work.
Here a Screenshot with the configured MAC and the ifconfig of eth0 with random MAC: http://imgur.com/a/8iPMi

root@firefly:~# uname -a
Linux firefly 4.4.16 #20 SMP PREEMPT Sat Mar 18 15:19:16 CST 2017 aarch64 aarch64 aarch64 GNU/Linux

Author: da_rinkes    Time: 3/24/2017 21:23
I added:
- "pr_warn("%s: generating random MAC on stmicro", priv->dev->name);"
   to drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

and can see this in the kernel-log:
root@firefly:~# dmesg | grep eth0
[    2.527372] eth0: PHY ID 001cc915 at 0 IRQ POLL (stmmac-0:00) active
[    2.527576] eth0: PHY ID 001cc915 at 1 IRQ POLL (stmmac-0:01)
[    7.125743] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    7.125925] eth0: generating random MAC on stmicro
[    7.125925] eth0: device MAC address f6:aa:ef:f3:9f:ab
[   13.243538] rk_gmac-dwmac fe300000.eth eth0: Link is Up - 1Gbps/Full - flow control rx/tx

So there is no MAC on this Hardware and the kernel generates random as suspected.

Author: isle    Time: 3/27/2017 09:39
Hi ,
yes ,we found  this issue,  we will fix it later,
Thanks for reminder us.
Author: korinel    Time: 3/29/2017 01:56
I'd appreciate a solution for this too, if possible.  
Author: isle    Time: 4/6/2017 10:24
Hi, we have fixed it,and will upload  the source code and the new tool later.
Author: mbmb    Time: 8/24/2019 00:51
How can we fix this problem?

Why don't you share your solution with the rest of us?
Author: penguin    Time: 8/26/2019 11:44
Hi @mbmb , with the latest Ubuntu 18.04 firmware, this issue has been fixed.

The mac address is handled in drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c in kernel.




Welcome Firefly Open Source Community (https://bbs.t-firefly.com/) Powered by Discuz! X3.1