How to figure out which NIC for NetworkInterfaceIndex

I have looked at this previously when I had multiple IP addresses on one NIC but now have three “virtual” NIC’s on a VM (different machine) and need to figure out which IP applies to which NIC. VSphere shows 3 NIC’s with 3 MAC addresses. Windows shows three NIC’s with the same three MAC addresses. I just don’t know how to pick the command line parm value for NetworkInterfaceIndex.

Other than trial and error is there any way?

Strangely in Windows they are numbered #2, #3, #4. I don’t know what happened to #1 but it probably was “lost” when originally setting up the VM a few years ago and a couple of “Do Overs” to reconfigure the VM. In VMWare they are numbered #1, #2, #3 but they are NOT in the same order as #2, #3, #4 in Windows. Based on the MAC I can figure out which NIC in Windows corresponds to the NIC in VMWare.

Without disrupting multiple Web Apps a running machine is there an easy way to figure out the NetworkInterfaceIndex value for each IP address? There are three Web Apps running as CGI on three IP addresses all port 80.

The whole point to to convert an app from CGI to Standalone on one of the IP addresses. I can take it down on the Web Server port 80 then bring up a Standalone version on port 80 … If I knew the NIC Interface Index.

Or I suppose I could experiment in the middle of the night.

Could I just take down the CGI app in question and then bring up the Stand Alone version using the command line parm 1 then 2 then 3 and see which works? I think I will get an error message if the port is already in use.

Thanks.

Just iterate through System.NetworkInterface and output to a list. The indexes are unlikely to ever change unless you’re adding or removing them.

Greg,

Thanks. I guess someday I need to look through the System “stuff” to see what other interesting things I can find.

I wrote a little command line tool and it just dumps out the configured interface info (IP, etc.) including the NIC number for all of the NIC’s.

Thanks for the help.