I have to differentiate between the real addresses and the VM addresses using any Windows API.
I'm using GetAdaptersAddresses
API to populate a list of IP addresses for the local machine. I need to extract only the "real" addresses apart from the addresses associated with the VMware network adapter and other addresses (auto-configuration and tunnel adapter addresses). I've not been able to find any API or any flag to differentiate this. Is there any way this can be done?
PS: The IfType
flag in the IP_ADAPTER_ADDRESSES
structure returned by GetAdaptersAddresses
doesn't help me differentiate between VMware addresses and the real addresses.
The possible virtual network adapters include three emulated types, three paravirtualized types, and a hybrid adapter. The emulated virtual network adapters are: The Vlance virtual network adapter, which emulates an AMD 79C970 PCnet32 NIC. Drivers for this NIC are found in most 32-bit operating systems.
Locate the virtual machine, right-click the VM and select Edit Settings. Select Add New Device and choose Add New Network Adapter. Expand New Network and ensure the Adapter Type is VMXNET3 and the Correct Network Portgroup is selected. Click OK.
To check the virtual network adapter using the vSphere/Virtual Infrastructure Client: In the vSphere/ Virtual Infrastructure Client, right-click the virtual machine in question and select Edit Settings. Highlight the virtual network adapter in the list of virtual hardware.
A virtual network adapter is the logical or software instance of a physical network adapter that allows a physical computer, virtual machine or other computer to simultaneously connect to a network or the Internet.
The beginning (first 3 segments) of the mac address shows if a interface is virtual:
"00:05:69"; //vmware1
"00:0C:29"; //vmware2
"00:50:56"; //vmware3
"00:1C:42"; //parallels1
"00:03:FF"; //microsoft virtual pc
"00:0F:4B"; //virtual iron 4
"00:16:3E"; //red hat xen , oracle vm , xen source, novell xen
"08:00:27"; //virtualbox
EDIT
To be more clear, if a interface has a MAC address that starts with any of the above given strings, then it's virtual.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With