s_lavie
asked on
Detecting multiple IPs
I have a machine with 3 active ip addresses defined on it.
There is only one network card on that machine - does it matter?
I tried to discovered all three by using:
InetAddress[] hosts = InetAddress.getAllByName(I netAddress .getLocalH ost().getH ostAddress ());
Nevertheless, hosts.length == 1
Why?
There is only one network card on that machine - does it matter?
I tried to discovered all three by using:
InetAddress[] hosts = InetAddress.getAllByName(I
Nevertheless, hosts.length == 1
Why?
Out of curiousity, how can you simultaneously have three active IP adresses on the same network card?
And what is the address it's returning?
ASKER
> Out of curiousity, how can you simultaneously have three active IP adresses on the same network card?
You just add IP address (at least on win2000 it works...)
> And what is the address it's returning?
The first IP it finds.
Anyway I managed to get all IPs by using:
InetAddress.getAllByName(I netAddress .getLocalH ost().getH ostName()) ;
Thanks anyway....
You just add IP address (at least on win2000 it works...)
> And what is the address it's returning?
The first IP it finds.
Anyway I managed to get all IPs by using:
InetAddress.getAllByName(I
Thanks anyway....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.