How is the Ethernet MAC address for usb0 defined?

michael at crosscode.org michael at crosscode.org
Tue Aug 7 23:43:35 CEST 2007


 	Hmm. Actually that's a very good note. It would probably be better to do
this in two parts - one that runs during the first boot of a new image (when
the opnmoko does other first-time things like generating a new ssh key) that
determines the usb device's MAC address and a second part that runs via the
hotplug mechanism to change the address when the device is loaded. This is
getting a little bit more complicated, and more interesting. I think I may 
go ahead and do this one...

- Michael

On Tue, 7 Aug 2007, Dr. H. Nikolaus Schaller wrote:

>>
>> 	This isn't a kernel problem - or at least it doesn't require a kernel 
>> fix.
>
> That is good news!
>
>> The usb driver's mac address can be set from userland, like so:
>> 
>> ifconfig usb0 down
>> ifconfig usb0 hw ether 45:23:ED:23:98:34
>
> I tried the same on the Sharp Zaurus (the OpenMoko is currently dead because
> of the battery charging issues).
>
> The Zaurus appears to permanently (re)set it to 40:00:01:00:00:01 each time 
> the
> USB cable is plugged into the host. Having this reset is a good approach...
>
> But this explains the trouble I had some time ago when I tried to connect two
> Zaurus devices to the same host... Both share the same MAC address :-)
>
>> 	Setting it to match the BT address (or the BT address plus one, which 
>> is
>> what I'd more likely expect; all my computers with multiple on-board 
>> ethernet
>> cards use consecutive mac addresses for each card) is fairly trivial 
>> *except*
>> that to get the BT mac address you have to load the BT modules and turn BT 
>> on,
>> so you'd be better off setting up a routine that does that if necessary but
>> then saves the new MAC address to disk and uses that disk cached value in 
>> the
>> future. It can all be done with a little bit of shell scripting on boot.
>
>



More information about the device-owners mailing list