Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

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

share|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
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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