Get active network interface on Windows
Posted
by
Kevin Walzer
on Super User
See other posts from Super User
or by Kevin Walzer
Published on 2011-11-18T02:34:55Z
Indexed on
2011/11/18
9:58 UTC
Read the original article
Hit count: 304
I'm developing an application that provides a UI to windump, the packet sniffer. Windump has a "-D" parameter that lists all network interfaces it can find, and then you can specify which interface to listen on. However, I'd like to avoid forcing the user to manually configure which interface to listen on. On Unix, I can obtain the right network interface (en0, en1, etc.) via a call to ifconfig and some parsing of the output, but I cannot locate any equivalent Windows API or command that can yield similar information--ipconfig doesn't seem to obtain this data. Can anyone suggest either a Windows command-line tool or an API that can be called via VBScript to obtain this data so that I don't have to present the user with a dialog in my GUI telling them to select the right interface?
© Super User or respective owner