Why does ioctl(sd, SIOCETHTOOL,&ifreq) on a virtual server running on VMware does not return the hardware address

319 views Asked by At

I am facing some issue in retrieving hardware address on a virtual server running on VMware.

I used to get the hardware address on a stand alone linux server using the C function
ioctl(sd, SIOCETHTOOL, &ifreq)
Now, I have configured a linux server on top of esxi VMware.
Now, the same C function returns the hardware address as '000000'.
Could someone help me in knowing if this is because of VMware and if so could you help me with some pointers on how it could be fixed. Your help is highly appreciated. Thanks.

1

There are 1 answers

0
Anirudh Kumar Agarwal On

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2062302 says that the same kind of issue was there in ESXi5.1 and fixed by installing bugfixes. But for ESXi 6.0, I didn't find any such bug fixes. I hope that we may get a bugfix shortly from VMware for this issue.

Check for this PR from the above link. "PR 1030731: When you use the ETHTOOL_GPERMADDR ioctl to obtain the permanent MAC address for a VMXNET3 NIC, if the Linux kernel version is between 2.6.13 and 2.6.23, no results are obtained. If the Linux kernel version is above 2.6.23, the MAC address returned contains all zeros."