G
Gordon Beaton
Is there anyway to detect a virtual IP address?
I currently use NetworkInterface to enumerate all local IP
addresses. I then filter out the isLocalAddress and all Inet6Address
objects, but I do not know how to detect a virtual IP address,
provided by VPN connection or VMWare.
The application binds the client socket to each NIC (IP address) on
the server to light up all interfaces, however Socket.bind() fails
on virtual IP addresses, so I need detect and filter them out.
It's not entirely clear what you mean by "the client binds the socket
to each NIC on the server". The *client* can't bind sockets to the
*servers* interfaces, it can bind sockets to its own interfaces. Do
you mean connect?
At any rate, it seems you answer your own question: do the filtering
by noticing which ones fail. Conceptually there is no difference
between the virtual interfaces created by vmware and any physical
interface. In particular they should appear equivalent to your
application (and I don't see why your operation should fail).
Another alternative is to see which ones are called "vmnet*".
/gordon