IP IP

P

Peter

Hi All
Here is the dump of "ipconfig" in windows

Windows IP Configuration


Ethernet adapter Local Area Connection 2:

Connection-specific DNS Suffix . : local.lan
IP Address. . . . . . . . . . . . : 192.168.2.2
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.2.1

Ethernet adapter Local Area Connection:

Media State . . . . . . . . . . . : Media disconnected

PPP adapter pccw:

Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 218.103.239.113
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . : 218.103.239.113

This System.out.println(InetAddress.getLocalHost().getHostAddress());
give me 192.168.2.2, but i want it give me the ip of PPP adapter. How
to?

thanks
from Peter ([email protected])
 
R

Roland

Hi All
Here is the dump of "ipconfig" in windows

Windows IP Configuration
[snips]

This System.out.println(InetAddress.getLocalHost().getHostAddress());
give me 192.168.2.2, but i want it give me the ip of PPP adapter. How
to?

thanks
from Peter ([email protected])
NetworkInterface.getNetworkInterfaces() might get the desired network
adapter.
<http://java.sun.com/j2se/1.5.0/docs/api/java/net/NetworkInterface.html#getNetworkInterfaces()>
--
Regards,

Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top