[SOLVED] Mac adress

Started by bbt, October 25, 2012, 07:24:16 pm

Previous topic - Next topic

bbt

October 25, 2012, 07:24:16 pm Last Edit: November 29, 2012, 10:35:56 am by bbt
Hi,
I want to fix the mac address of my OLinuxino Maxi.
I saw in ArchLinux for ARM that it is possible.
I followed their instructions :
"The mac address is set based on the contents of /usr/local/mac_addr since the OLinuXino's ethernet controller generates a random address each boot. "
... but it doesn't work.
A every boot the mac address changes so my DHCP give a new IP...

I think the problem is to try to use a daemon named set-olinuxino-mac ...
But I don't know why and how to correct it ?
Did somebody succeed ?

Thank you very much.

flavigny

hello,

sorry, I encountered the same later, I don't solved it.
here is how I bypassed this step, setting a fixed IP (not using dhcp):

ifconfig usb0 192.168.0.200
route add default gw 192.168.0.254
rm /etc/resolv.conf
echo > /etc/resolv.conf nameserver 212.27.40.241

of couse, to be modified to your network;

Regards.
PO.

srbyers

Hi, I've tried setting a static IP as described, but the board reverts to dhcp on reboot, am I missing something? This the maxi board with the supplied microSD card, 2.6.35-6-ARCH+. Thanks for any help.
Steve

peter

October 28, 2012, 11:14:08 pm #3 Last Edit: October 28, 2012, 11:16:12 pm by peter
hi!

I fix mac address by creating a file: /etc/rc.d/functions.d/macspoof

Contents of this file are:

spoof_mac() {
        ip link set dev usb0 address 01:02:03:04:05:06
}

add_hook sysinit_end spoof_mac


Make the address (01:02:03:04:05:06) whatever you like. This method fix mac-address in my OLinuxino Maxi

Peter.

srbyers

Hi

For other newbies like me, I found that you set a static ip by editing the /etc/rc.conf file and entering the ip information as described in the example shown in that file. You will also need to edit the /etc/resolv.conf file to enter the nameserver.
Steve

flavigny

Hello,
(I use Yocto generated by Otavio, on 20120807)
I start my work fixing Ip address (see previous reply),
now I found how to fix mac address:
in file /etc/network/interfaces, locate line iface usb0 ...
and insert below a line:
     hwaddress ether 00:11:22:33:44:55

Regards
PO.

bbt

Hi,
I finally found the solution :
In fact, I wrote a mac adress in hexa such as : 5B:5F:01:01:01:01
and it seems this was the problem.

I replaced with 50:50:01:01:01:01
in /usr/local/mac_addr and now it works very well...

I couldn't use fixed IP in this application.
Thanks a lot

flavigny

Oooops,
your interpretation (suggesting address using only 0-9 digits) is wrong!
origin of reject is that the first byte of mac-address MUST be even (for unicast), so moving from 5F to 50 is accepted. However 5E will also be accepted but 51 rejected.
Regards
PO