1

I am writting a script in bash that detect all interfaces and change their MAC to another one random. I need to know where can I find the permanent MAC of interfaces.

If I use ifconfig $interface, the output is not a real MAC... (the same with cat /sys/class/net/$interface/address

The only way that I found was with cat /etc/udev/rules.d/70-persistent-net.rules, it show the original mac, but, if I have a wireless card in monitor mode (mon0 for example), this method will not work... :(

Exist some method (like macchanger -s $interface), where I can see my permanent MAC with virtual interface??

Note: Sorry for my bad english :S

user2757192
  • 115
  • 2
  • 9
  • possible duplicate of [Finding original MAC address from Hardware itself](http://stackoverflow.com/questions/14955504/finding-original-mac-address-from-hardware-itself) - it really doesn't look to be possible unless you record it somewhere before futzing around with it – Anya Shenanigans Sep 12 '13 at 15:37

1 Answers1

1

To get the smbios mac address you can use dmidecode. dmidecode dumps the boxes DMI table contents so all the systems hardware components, as well as serial numbers, and BIOS revisions.

 [root@server ~]# dmidecode | grep -i mac
                MCE (Machine check exception)
                MCA (Machine check architecture)
HP BIOS NIC PCI and MAC Information
        NIC 1: PCI device 03:00.0, MAC address 1C:69:F5:4B:24:Y8
        NIC 2: PCI device 03:00.1, MAC address 1C:69:F5:4B:24:Y8
HP BIOS iSCSI NIC PCI and MAC Information
Peter Party Bus
  • 2,326
  • 1
  • 14
  • 15