VMware {code} Community
deepakmits
Contributor
Contributor

How to get the mac address, network interface and type of network(duplex etc.) for an NIC on host ?

I want to know that are there APIs available to get the mac address, network interface and type of network(duplex etc.) for an NIC on host(ESX) .

Thanks !

0 Kudos
2 Replies
stumpr
Virtuoso
Virtuoso

Most of the data I think you want would be under the HostNetworkConfig object.

pnic would be used to get the linkspeed and mac of the physical nic.

You probably want the vnic object to get your mac address vnic->spec->mac for the mac actually seen by your switches for the console. VMs will have their own macs as well.

I believe some of these object properties are new after the 2.5 version of the SDK, so might not work on the older version.

Reuben Stump | http://www.virtuin.com | @ReubenStump
0 Kudos
deepakmits
Contributor
Contributor

Thanks.

0 Kudos