friendlyarm / h3_lichee

BSP for FriendlyARM NanoPi H3
106 stars 104 forks source link

Does NanoPiNEO's GigE Mac Address randomly change from time to time, after rebooting? #21

Closed jiapei100 closed 6 years ago

jiapei100 commented 6 years ago

Hi, I met another weird issue:

I tried to setup a static IP address for my NanoPi NEO, which should actually bundle the NanoPI NEO's GigE MAC address and the static IP. Whenever I reboot the NanoPI NEO, its GigE MAC address changes, and an random IP address is automatically allocated, via DHCP.

I mean, the previous MAC address did bundle to the static IP address that I allocated. However, there always exists a 2nd HOST name NanoPINEO which has a NEW MAC address and is allocated to a NEW IP address automatically.

I'm not sure if this is an issue of the latest kernel I've just built? Or it is an issue of the FriendlyARM BSP for AllWinner H3 ? I posted the question on armbian, FriendlyARM and AllWinner H3.

About the current NanoPiNEO (I'm still able to ssh into the random allocated IP address):

Welcome to ARMBIAN 5.38 stable Ubuntu 16.04.3 LTS 4.14.16-sunxi   
System load:   0.10 0.03 0.01   Up time:       2:53 hours
Memory usage:  11 % of 240MB    IP:            192.168.0.221
CPU temp:      40°C           
Usage of /:    16% of 15G    

Last login: Sat Feb  3 10:16:26 2018 from 192.168.0.10

jiapei@nanopineo:~$ uname -a
Linux nanopineo 4.14.16-sunxi #1 SMP Thu Feb 1 14:17:29 CST 2018 armv7l armv7l armv7l GNU/Linux
jiapei@nanopineo:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial
jiapei@nanopineo:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 7e:f0:16:00:3c:a7 (**this MAC address changes**)
          inet addr:192.168.0.221 (this IP address changes randomly as well) Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::ad9e:7328:d3ae:8681/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9133 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2356 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3621111 (3.6 MB)  TX bytes:194164 (194.1 KB)
          Interrupt:33 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:44 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4043 (4.0 KB)  TX bytes:4043 (4.0 KB)

jiapei@nanopineo:~$
jiapei100 commented 6 years ago

Problem solved... https://forum.armbian.com/topic/6354-does-nanopineos-gige-mac-address-randomly-change-from-time-to-time-after-rebooting/

Thank you

wuweidong0107 commented 6 years ago

Sorry,We don't maintain armbian's rom. In friendlyelec's rom: $ cd uboot $ grep mac_node ./* -nR ./board/sunxi/board.c:778: char mac_node[32]; ./board/sunxi/board.c:779: sprintf(mac_node, "[%x %x %x %x %x %x]", \ ./board/sunxi/board.c:783: env_set("mac_node", mac_node); ./board/sunxi/board.c:784: sprintf(mac_node, "[%x %x %x %x %x %x]", \ ./board/sunxi/board.c:788: env_set("wifi_mac_node", mac_node); and check boot.cmd: fdt set ethernet0 local-mac-address ${mac_node}