Tags: IP Address Lookup, Information, and Location, Test Your Internet Connection Speed
|
|
|
#1
|
|||
|
|||
|
Hi,
My computer(single) is connected to internet through an ISP Provider (DSL connection via Ethernet). I get the IP dynamically when i connect to Internet. It is not same as my static IP that i gave during setup. I found the dynamic IP from whatismyip.com. Thanks to it. Now i need to find my dynamic IP using Java code. I tried with "InetAddress" class but all classes shows only my static IP. how to do it? Thankyou ![]() |
|
#2
|
||||
|
||||
|
Your machine has an IP address on the local area network (LAN), and your network has a different address on the Internet (Wide Area Network, or WAN). The WAN address is provided by your ISP. You can configure your own LAN.
The conversion from the WAN to LAN is achieved by your router. So your code (be it in Java, Perl, Python or whatever) can only obtain the machine address (from the LAN). It will need to speak to a device on the WAN to obtain your WAN IP. You could curl your network from the internet. The command: Code:
curl http://whatismyip.com/automation/n09230945NL.asp Here's some Java code which works for me:http://www.computing.dcu.ie/~humphry...orks/java.html Last edited by clanmills; 08-05-2008 at 12:02 AM.. Reason: add the java url |
|
#3
|
|||
|
|||
|
Hi Mr. clanmills
Your suggestion is very useful to me. I am happy with your immediate response. Thank you. Thank you very much. ![]() |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|