Welcome, Guest

Author Topic: [SOLVED] Mac adress  (Read 4916 times)

bbt

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
[SOLVED] Mac adress
« on: October 25, 2012, 07:24:16 PM »
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.
« Last Edit: November 29, 2012, 10:35:56 AM by bbt »

flavigny

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +0/-0
Re: Mac adress
« Reply #1 on: October 26, 2012, 07:40:44 AM »
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

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Mac adress
« Reply #2 on: October 27, 2012, 07:54:39 PM »
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

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: Mac adress
« Reply #3 on: October 28, 2012, 11:14:08 PM »
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.
« Last Edit: October 28, 2012, 11:16:12 PM by peter »

srbyers

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Mac adress
« Reply #4 on: November 04, 2012, 06:37:31 PM »
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

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +0/-0
Re: Mac adress
« Reply #5 on: November 05, 2012, 10:30:56 AM »
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

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Mac adress
« Reply #6 on: November 14, 2012, 03:28:43 PM »
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

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +0/-0
Re: Mac adress
« Reply #7 on: November 16, 2012, 02:02:08 PM »
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