0

I need to read permanent (burned-in) MAC address of network adapter. Since MAC address can be easily spoofed, I need to read the real one which is written on EEPROM. I need to do it using C++ on Linux.

I tried using ethtool which is quite good and works fine. However on some systems it does not work as intented.

ethtool -P eth0

returns this:

Permanent address: 00:00:00:00:00:00

and

ethtool -e eth0

returns this:

Cannot get EEPROM data: Operation not supported

Network Adapter has following info:

  • driver: ucc_geth
  • version: 1.1
  • firmware-version: N/A
  • bus-info: QUICC ENGINE

Linux kernel version is: 2.6.32.13

Question is: Can i fix this issue with any update(driver, kernel etc)?

Additionally, I make the same ethtool calls with ioctl function in C++. Is there any way to fix this inside the code? Or is there any other way to get the permanent MAC address from EEPROM?

4

2 回答 2

1

如果你还没有找到答案,你可能想看看这个。

https://serverfault.com/questions/316976/can-i-get-the-original-mac-address-after-it-has-been-changed

于 2014-06-17T08:25:46.723 回答
0

看看几件事。

  1. 查看从该 NIC 发出的线路上的数据包(使用嗅探器)并查看正在使用的 MAC 地址。
  2. 查看“ifconfig -a eth0”的输出。如果 MAC 地址与网络上的相同,那么您可以使用ifconfig 使用的机制获取该 MAC 地址。
于 2013-09-05T08:07:47.593 回答