• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: MAC address the same for each plug?  (Read 3669 times)
suncream25
Newbie
*

Karma: 0
Posts: 3


View Profile
« on: October 04, 2010, 12:40:30 PM »

Does each plug have a the same MAC address? I've used the command ifconfig -a and I get the same mac address. Will this cause problems long term?
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« Reply #1 on: October 04, 2010, 03:48:40 PM »

Does each plug have a the same MAC address?
Only if you've updated the uboot and forgotten to set the MAC address for each specific device by editing it into the config file.
Quote
I've used the command ifconfig -a and I get the same mac address. Will this cause problems long term?
Yes - if they are on the same network, as everything else will think that are one and the same device.
You can set a MAC address as the system boots by adding a line like this:
Quote
hwaddress ether 00:50:43:01:23:45
to your /etc/network/interfaces file in the relevant section (under "iface eth0"?)  (Well - that's what I've got commenetd out, as I had to do this once when I originally forgot to set mine - but just "hw addr 00:50:43:01:23:45" may also work).  You should change that MAC address to the one written on the sticker of you Plug (I trust you have good eyesight, or a magnifying glass?).
Logged

lastactionseo 2010
Newbie
*

Karma: 0
Posts: 2


View Profile
« Reply #2 on: October 05, 2010, 02:35:27 PM »

You can set a MAC address as the system boots by adding a line like this: ...

Thanks birdman! This was also an information I serached for!
Logged

marcus
Jr. Member
**

Karma: 5
Posts: 83


View Profile
« Reply #3 on: October 06, 2010, 11:17:19 AM »

Does each plug have a the same MAC address? I've used the command ifconfig -a and I get the same mac address.


There is a sticker on the underside of every Sheevaplug & Guruplug. The MAC address(es) of the plug should in all cases match the MAC address shown by ifconfig.


However ... in all the plugs I have seen, I think I have twice seen a difference between the outside of the plug and the actual MAC address. The process by which the MAC addresses are set (or, I suppose, the stickers are attached) is manual, so errors seemingly can occur.

You can change the MAC address on a Sheevaplug by entering at the U-Boot prompt:

Code:
setenv ethaddr F0:AD:4E:00:xx:xx
saveenv
reset

Of course you MUST use a valid and appropriate MAC address; the one I've given above is not valid but shows the format of the command. Use the actual MAC address from the sticker on your plug.
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« Reply #4 on: October 06, 2010, 05:31:11 PM »

You can change the MAC address on a Sheevaplug by entering at the U-Boot prompt:
You couldn't on mine when I forgot to set the correct MAC when flashing.  You could issue those commands, but they had no effect.
I had to re-flash.
Logged

emstester
Newbie
*

Karma: 1
Posts: 24


View Profile
« Reply #5 on: October 06, 2010, 06:46:07 PM »


You couldn't on mine when I forgot to set the correct MAC when flashing.  You could issue those commands, but they had no effect.
I had to re-flash.

Interesting, because you are just actually doing same, setting it as an env variable for ethaddr during flashing, sure you do the saveenv? Roll Eyes
Logged

odoll
Full Member
***

Karma: 0
Posts: 148


View Profile
« Reply #6 on: October 07, 2010, 03:46:32 AM »

Just being curious: is it really required to set the MAC address in U-Boot!? (I also set the MAC to the info on my plug's sticker after flashing to a new U-Boot release, but currently hard for me to test as my plug is productive sitting in the basement far away from a console :-()
Of course setting a wrong/foreign MAC might cause issues, however what MAC is used if no one is set (00:...)?
Looking at other systems they normally use their native MAC if nothing is defined/overruled?!
Of course if you flash U-Boot it comes with a predefined default MAC address setting, but what will happen if you remove it
Code:
setenv ethaddr
saveenv
if allowed at all?!
Logged

sfzhi
Jr. Member
**

Karma: 1
Posts: 83


View Profile
« Reply #7 on: October 07, 2010, 10:46:47 AM »

what MAC is used if no one is set (00:...)?
I can't speak for other sorts of plug computers, but on GuruPlug you will end up with 00:00:00:00:00:00.

Looking at other systems they normally use their native MAC if nothing is defined/overruled?!
What is "native" MAC?
If by other systems you mean the "big" desktops/servers then the explanation is quite simple.
The "big" network adapters usually have a small non-volatile memory chip where the MAC address is stored. The Ethernet controller chip reads it upon powering up without software intervention. In the embedded world it may be too much luxury to have an extra chip just for that. Some Ethernet controller chips have built-in memory for MAC that can be preprogrammed at the factory. In either case the production costs increase.
Logged

Lack of knowledge is not such a big problem, unwillingness to learn is.

odoll
Full Member
***

Karma: 0
Posts: 148


View Profile
« Reply #8 on: October 07, 2010, 11:48:52 AM »

Thx sfzhi, I just did the test on my SheevaPlug with the following (odd) result:

My U-Boot version is: U-Boot 1.1.4 (Dec 27 2009 - 22:03:21) Marvell version: 3.4.27 - pingtoo patch.01

During my first attempt I "deleted" the arguement for the ethaddr environment variable, saved the settings and booted the system. Hence it came up with the right address. My first guess was: "Hurray, it's working", but found this to be the wrong conclusion later, because:

When I did a second reboot, the system came up with no eth interface at all, just the loopback!?

So I went into U-Boot again to see what happened and was surprised to find (printenv) the ethaddr env-var set as

ethaddr=00:50:43:a6:0c:23

So I started the system over and again, but again no eth int.

Back in U-Boot the ethaddr arg was different again and seems to be changing randomly from reboot/reset to reset.

ethaddr=00:50:43:98:04:26
ethaddr=00:50:43:b6:36:29
ethaddr=00:50:43:79:23:2f

So my guess what happened: during my first attempt I just altered the U-Boot settings after the system had already been initialized and as I just issued a boot rather than reset command it came up with the expected MAC addr.

However something is still odd with the U-Boot:
i) though the ethaddr is null in the saved config(?) the u-boot printenv command delivers a random result.
ii) however the u-boot is not using that random MAC address to initialize the interface and thus the OS shows no eth int!?

Only after I set the ethaddr again the plug comes up with that interface enabled.
This can be very misleading as printenv gives you an address though none is set.

Now finding this it reminded me of that strange behavior I run in before, but which gets a _bit_ clearer, now. (http://plugcomputer.org/plugforum/index.php?topic=1304.msg8181#msg8181)

PS: Update in short how it "works"

Marvell>> setenv ethaddr
Marvell>> printenv ethaddr
## Error: "ethaddr" not defined
Marvell>> saveenv
Saving Environment to NAND...
Erasing Nand...Writing to Nand... done
Marvell>> reset
[...]
Marvell>> printenv ethaddr
ethaddr=00:50:43:42:34:37
Marvell>> printenv ethaddr
ethaddr=00:50:43:42:34:37
Marvell>> reset
[...]
Marvell>> printenv ethaddr
ethaddr=00:50:43:ea:2d:38

and so on ...

PS2: I only have an eth0 if I set the "right" MAC address in u-boot.
« Last Edit: October 07, 2010, 12:09:01 PM by odoll » Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #9 on: October 07, 2010, 06:58:51 PM »

The generated ethaddr is Marvell u-boot port specific function. the last 3 number is base on day of the year and time of the day with some shifting bits to generate. the code check if the ethaddr is not set then it will use generated number to set its value. if you let it generate then do a "saveenv" it will be there when you next reboot.

Logged

Good Luck Smiley

sfzhi
Jr. Member
**

Karma: 1
Posts: 83


View Profile
« Reply #10 on: October 08, 2010, 01:14:35 AM »

Some versions of U-Boot require the "ping" hack for the value of "ethaddr" to be actually applied. Don't know if this applies to the version mentioned here.

In my case (GuruPlug Server Plus), if the MAC address was not set the eth* interface would still show up in the OS with the MAC address of all zeroes.
Logged

Lack of knowledge is not such a big problem, unwillingness to learn is.

guidol
Full Member
***

Karma: 10
Posts: 128



View Profile
« Reply #11 on: November 09, 2010, 02:23:10 PM »

The generated ethaddr is Marvell u-boot port specific function. the last 3 number is base on day of the year and time of the day with some shifting bits to generate. the code check if the ethaddr is not set then it will use generated number to set its value. if you let it generate then do a "saveenv" it will be there when you next reboot.

I also got the problem of changing MAC-addresses.
I used setenv and saveenv without luck, but after reading
http://plugcomputer.org/plugforum/index.php?topic=924.msg5780#msg5780
I used set and setenv and it works :-))
Logged

Pages: [1]
Print
Jump to: