MAC address of U3 keep changing

Post Reply
thamvmk
Posts: 27
Joined: Fri Dec 27, 2013 11:07 am
languages_spoken: english
ODROIDs: odroid u3, eMMC 8GB-android, eMMC 16GB, archlinux
odroid c2, archlinux
odroid hc1, ubuntu 18.04
odroid c1, android 4.4
Has thanked: 4 times
Been thanked: 1 time
Contact:

MAC address of U3 keep changing

Post by thamvmk »

Hi,
I'm trying to assign a fixed IP for my odroid, but I noticed that everytime it is rebooted then I will get a new MAC address. Therefore, I can't assign Fixed IP by MAC address. Anyone can help?
Vincent

mdrjr
Site Admin
Posts: 11786
Joined: Fri Feb 22, 2013 11:34 pm
languages_spoken: english, portuguese
ODROIDs: -
Location: Brazil
Has thanked: 1 time
Been thanked: 39 times
Contact:

Re: MAC address of U3 keep changing

Post by mdrjr »

Do the following:

ifconfig eth0 down
rmmod smsc95xx
modprobe smsc95xx
rmmod smsc95xx
modprobe smsc95xx
reboot

User avatar
odroid
Site Admin
Posts: 37528
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1835 times
Been thanked: 1155 times
Contact:

Re: MAC address of U3 keep changing

Post by odroid »

Can you check /etc/smsc95xx_mac_addr?

Which Android OS image do you use?

thamvmk
Posts: 27
Joined: Fri Dec 27, 2013 11:07 am
languages_spoken: english
ODROIDs: odroid u3, eMMC 8GB-android, eMMC 16GB, archlinux
odroid c2, archlinux
odroid hc1, ubuntu 18.04
odroid c1, android 4.4
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: MAC address of U3 keep changing

Post by thamvmk »

mdrjr wrote:Do the following:

ifconfig eth0 down
rmmod smsc95xx
modprobe smsc95xx
rmmod smsc95xx
modprobe smsc95xx
reboot
Yes, run those commands and it fixed the MAC address. Why is this behaving like that? Just try to learn somethings as I've not seam this type of behaviour before.

Thanks
Vincent

mdrjr
Site Admin
Posts: 11786
Joined: Fri Feb 22, 2013 11:34 pm
languages_spoken: english, portuguese
ODROIDs: -
Location: Brazil
Has thanked: 1 time
Been thanked: 39 times
Contact:

Re: MAC address of U3 keep changing

Post by mdrjr »

Our SMSC95xx lan chip doesn't have an EEPROM to store a fixed mac address.
We modified the kernel drivers to store the mac address on a file :)

If for some reason on boot it can't write the file it will default to a random mac address.

What you did there is unload and load the module when the filesystem was ok already so it could create the mac address file.

User avatar
OverSun
Posts: 1493
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english
Has thanked: 0
Been thanked: 19 times
Contact:

Re: MAC address of U3 keep changing

Post by OverSun »

The situation is like this: The driver tries to read /etc/smsc95xx_mac_addr (or /data/misc/smsc95xx_mac_addr if ANDROID_PARANOID_NETWORK) to set the mac address from that file, but when the kernel boots that early stage when driver loads there are no filesystem underlaying. So no file is read in case the driver is solid with the kernel. In the case the driver is a module, again in the most of the cases when the driver is loaded the underlying filesystem is initrd which is not your filesystem at all and doesn't has this file. Even if your normal partition does. You have to streamline it into initrd, rebuild it and reboot, and it's not that easy task to do.
But it's the whole other story when you remove/insert a module when your system is already booted. The file is there, so the code gets removed from kernel, and then inserted back initializing from the scratch, reading the file with predefined MAC and viola! - everything is in place.

I proposed a patch to add the ability to set the mac in kernel boot parameters, but looks like mdrjr was too busy to streamline it. Let's just wait a little more and have some patience.

spcano01
Posts: 70
Joined: Wed Jan 08, 2014 2:17 am
languages_spoken: english
ODROIDs: XU-Lite
Has thanked: 0
Been thanked: 0
Contact:

Re: MAC address of U3 keep changing

Post by spcano01 »

Any final solve for this? Does the code thmamvmk propose fix the random MAC address, or just set it while it's on?

mdrjr
Site Admin
Posts: 11786
Joined: Fri Feb 22, 2013 11:34 pm
languages_spoken: english, portuguese
ODROIDs: -
Location: Brazil
Has thanked: 1 time
Been thanked: 39 times
Contact:

Re: MAC address of U3 keep changing

Post by mdrjr »

spcano01 wrote:Any final solve for this? Does the code thmamvmk propose fix the random MAC address, or just set it while it's on?
Its was a bug on a Android image..

standmit
Posts: 1
Joined: Sat May 16, 2020 2:38 pm
languages_spoken: english, russian
ODROIDs: U3
Has thanked: 0
Been thanked: 0
Contact:

Re: MAC address of U3 keep changing

Post by standmit »

Hello! I have the same problem. Odroid-U3, Ubuntu 18.04 from this topic: viewtopic.php?f=77&t=31765
mdrjr wrote:
Thu Jan 23, 2014 9:01 am
Do the following:

ifconfig eth0 down
rmmod smsc95xx
modprobe smsc95xx
rmmod smsc95xx
modprobe smsc95xx
reboot
I get the error:

Code: Select all

rmmod: ERROR: Module smsc95xx is builtin.
Is there another way?

Post Reply

Return to “Android”

Who is online

Users browsing this forum: No registered users and 2 guests