6

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?

Ward - Trying Codidact
  • 12,899
  • 28
  • 46
  • 59
naugtur
  • 284
  • 3
  • 11

2 Answers2

6

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

Zypher
  • 37,405
  • 5
  • 53
  • 95
  • 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 06 '11 at 17:57
1

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

derjur
  • 241
  • 2
  • 7