If you haven't find the answer yet, you might want to check this out.
ethtool get permanent MAC address returns all 0's
-
27-06-2022 - |
Question
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?
Solution
OTHER TIPS
Take a look at a couple of things.
- Look at packets on the wire (using a sniffer) emanating from this NIC and see the MAC address being used.
- Look at the output of "ifconfig -a eth0". If the MAC address is the same as on the wire, then you can get that MAC address using the mechanism that ifconfig uses.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow