I am using some linux machines that have had their MAC address changed. I would like to be able to read it back with a shell script.

Is the original MAC address stored anywhere except the sticker on the box? How do I bring back the original hardware address?

link|improve this question
feedback

2 Answers

you can check you dmesg logs it will report the hardware MAC address as seen on boot.

on one of my boxes the output looks like:

gbeech@ny-man01:~$ dmesg | grep eth0
[    6.533181] eth0: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem d6000000, IRQ 36, node addr 00:21:9b:a0:b7:cc

what you are interested in is the node addr 00:21:9b:a0:b7:cc bit at the end

link|improve this answer
Guess what... I'm using a weird ARM machine with uBoot that sets mac to a value from settings and I have to duplicate the settings between machines, so... I ended up saving the mac address in a file and setting it up on each boot. But thanks! – naugtur Oct 6 '11 at 17:57
feedback

Might be on the physical card, or etched onto the motherboard. I doubt you can access it from a script however.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.