Random generated MAC address on eht0

Forum to discuss the new MK902II LE RK3288 Quad Core Linux Mini PC.

Moderators: KEgg, twjordo, tatubias

Random generated MAC address on eht0

Postby giupmat » Mon Dec 22, 2014 10:10 am

I'm working on a MK902II LE and I experienced a really serious issue. The MAC address of the network adapter (eth0) changes at every boot, as if it were randomly generated. Is this a known bug? Is there any existing solution for this problem?
giupmat
 
Posts: 30
Joined: Wed Dec 03, 2014 10:56 am

Re: Random generated MAC address on eht0

Postby bam » Thu Feb 19, 2015 11:28 am

Same questions here, with a very similar issue with my MK902II LE
It seems that the wlan0 adapter can choose from 2 MAC addresses. It just randomly picks one at boot time.

The 2 addresses are
00:90:4c:11:22:33 (vendor = Epigram, but seems like a test MAC address)
6c:fa:a7:59:2a:c1 (vendor = AMPAK Technology Inc. this seems more like a real address)

On top of that, there is a difference when I check the MAC address using the terminal or the GUI:
  • terminal:
    Code: Select all
    $ ifconfig
    wlan0     Link encap:Ethernet  HWaddr 6c:fa:a7:59:2a:c1 
              inet addr:192.168.0.157  Bcast:192.168.0.255  Mask:255.255.255.0
  • GUI:
    Xubuntu Settings Manager -> Network Connections -> wlan0 -> MAC address = 00:90:4c:11:22:33
The MAC address returned by ifconfig is the one that was used when sending a dhcp request.

Anyone experiencing the same issue?
If so, do you have the same MAC address ending in 11:22:33 ?
Any idea how to solve this? Workaround by rebooting until I don't see the 11:22:33 address?
bam
 
Posts: 12
Joined: Mon Feb 16, 2015 1:48 pm

Re: Random generated MAC address on eht0

Postby giupmat » Thu Feb 19, 2015 3:07 pm

Is a very stupid issue, mate: running Debian you can override the MAC address thru /etc/network/interfaces, adding the following line.
Code: Select all
hwaddress ether 01:23:45:65:43:21

Running Ubuntu, however, the NetworkManager service prevents using this configuration.
giupmat
 
Posts: 30
Joined: Wed Dec 03, 2014 10:56 am

Re: Random generated MAC address on eht0

Postby bam » Fri Feb 20, 2015 12:50 pm

Thanks for your fast response.

However, I don't understand: the box does run Xubuntu, and the /etc/network/interfaces file is empty:

Code: Select all
$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
$ ls -l /etc/network/interfaces.d
total 0


Where does the second MAC address come from?
bam
 
Posts: 12
Joined: Mon Feb 16, 2015 1:48 pm

Re: Random generated MAC address on eht0

Postby giupmat » Mon Feb 23, 2015 8:27 am

Yes, I know. I think that easiest (and probably also fastest) solution is install macchanger package.
Code: Select all
apt-get install macchanger
macchanger --mac=01:23:45:67:89:AB eth0

Let me know...
giupmat
 
Posts: 30
Joined: Wed Dec 03, 2014 10:56 am

Re: Random generated MAC address on eht0

Postby bam » Mon Feb 23, 2015 1:45 pm

Thanks guipmat, this seems to work.

I just added
Code: Select all
macchanger --mac=6c:fa:a7:59:2a:c1 wlan0
to rc.local

Now, when it boots with MAC 00:90:4c:11:22:33, the mac gets changed:
Code: Select all
Current MAC:   00:90:4c:11:22:33 (EPIGRAM, INC.)
Permanent MAC: 00:90:4c:11:22:33 (EPIGRAM, INC.)
New MAC:       6c:fa:a7:59:2a:c1 (unknown)

When it boots with MAC 6c:fa:a7:59:2a:c1, it will stay the same:
Code: Select all
Current MAC:   6c:fa:a7:59:2a:c1 (unknown)
Permanent MAC: 00:90:4c:11:22:33 (EPIGRAM, INC.)
New MAC:       6c:fa:a7:59:2a:c1 (unknown)
It's the same MAC!!


Now I just wonder:
I only have one device now, but we will need more (e.g. 10) in the field. We want to uniquely identify them by MAC address. So I want to be sure one of both addresses is unique before we buy extra devices.
  • The one that ends in 11.22.33 sounds not unique to me. Can you (or anyone) confirm that you have the same permanent MAC for the wlan0 interface?
  • Would the other mac address be unique over different MK902 ? Does anyone have the same address on wlan0?
bam
 
Posts: 12
Joined: Mon Feb 16, 2015 1:48 pm

Re: Random generated MAC address on eht0

Postby giupmat » Mon Feb 23, 2015 2:37 pm

Your "permanent MAC" is the same on every device made by Riko. This MAC address is embedded in the firmware code, you can easily discover it in dmesg:
Code: Select all
dmesg |grep 11:22:33

...and also you can find it somewhere in the udev config (I think writed by /lib/udev/write_net_rules).
I have the same problem too: my company needs to install a bunch of device in the same LAN... I'm still working on a solid solution.
giupmat
 
Posts: 30
Joined: Wed Dec 03, 2014 10:56 am

Re: Random generated MAC address on eht0

Postby andykirby » Wed Feb 25, 2015 9:10 am

See this:

http://developer.t-firefly.com/en/viewt ... da2b4328d2




Sent from my iPhone using Tapatalk
andykirby
Site Admin
 
Posts: 339
Joined: Sun May 27, 2012 7:48 pm

Re: Random generated MAC address on eht0

Postby giupmat » Wed Feb 25, 2015 9:47 am

Thanks Andy, I tried to flash the MAC address thru parameter file (with RKFlashTool) and something went wrong, MK ignores the setting. I'll try asap to set MAC with this tool.
giupmat
 
Posts: 30
Joined: Wed Dec 03, 2014 10:56 am

Re: Random generated MAC address on eht0

Postby bam » Fri Feb 27, 2015 12:48 pm

Thanks for the link Andy. But:
  • It says: to put the board in loader mode, refer to http://wiki.t-firefly.com/index.php/Firefly-RK3288/Flash_image/en, and there:
    Press and hold RECOVERY key.
    Shortly press RESET key.
    After around two seconds, release RECOVERY key.
    Note:If device still can not be found after pressing RESET, then try this: long press PWRKEY after short pressing of RESET, before finally releasing RECOVERY.

    I don't have a developper board so I don't have these keys. Can I somehow still do this?
  • This will set the Mac addresses of BOTH interfaces to the same address. If I want to have different addresses, I would need another kernel patch as described in the comments of your link.
Also, this question is still important to me:
Will the 6c:fa:a7:59:2a:c1 Mac address (i.e. my wlan0's second mac address, see previous posts) be different if I have multiple MK902 ?
bam
 
Posts: 12
Joined: Mon Feb 16, 2015 1:48 pm

Next

Return to Rikomagic / Cloudsto MK902II LE RK3288 Quad Core Linux Mini PC

Who is online

Users browsing this forum: No registered users and 3 guests