my dog learned polymorphism*
The moose likes Sockets and Internet Protocols and the fly likes IP address of my computer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "IP address of my computer" Watch "IP address of my computer" New topic
Author

IP address of my computer

Jane Somerfield
Ranch Hand

Joined: Jul 20, 2002
Posts: 193
I can find my computer's IP address with ipconfig in window, but this web site
(http://www.ip-adress.com/) shows me a completely different one. Which one
is right and why?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18708
    
    8

Your computer's IP address which ipconfig reports is the address of your computer in a LAN (Local Area Network). This LAN is a self-contained unit and within it there's something that assigns addresses to computers in the network.

You'll find that your LAN is connected to the Internet via a router. Essentially the router communicates with other Internet sites on behalf of all computers on your network, you don't connect directly. This router belongs to both networks; in your LAN it has a LAN address, but it also has an Internet address. The latter is what the ip-address.com site shows you.
Jane Somerfield
Ranch Hand

Joined: Jul 20, 2002
Posts: 193
What if my computer got a static IP? Should ipconfig and the web site give the
same IP?
[ May 09, 2008: Message edited by: Jane Somerfield ]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18708
    
    8

It's perfectly possible that your network administrator set up your computer with a static IP address in your LAN. All that means ("static IP") is that your IP address won't ever change; often networks are set up so that IP addresses are reassigned from time to time.

It's also perfectly possible that the router connecting your network to the Internet was assigned a static IP address by your ISP (Internet Service Provider).

At any rate, perhaps you should ask your network administrator these questions. You do have a LAN, don't you? Then it must have an administrator.
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

Originally posted by Paul Clapham:
You do have a LAN, don't you? Then it must have an administrator.


I hate that assumption. :-)

Everyone has a lan in their house these days, and most folks are pretty weak LAN administrators. Even those of us who are talented and good looking.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18708
    
    8

Originally posted by Pat Farrell:
Everyone has a lan in their house these days, and most folks are pretty weak LAN administrators. Even those of us who are talented and good looking.
Scary thought, isn't it? Somebody who would call the plumber to clean out their plugged sink, but they are running their own TCP network. I'm guilty as charged. Well, at least I read Networking for Dummies before I did that. And I'm really not that good-looking either.

But joking aside, you're right.
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

Originally posted by Jane Somerfield:
I can find my computer's IP address with ipconfig in window, but this web site www.ip-adress.comshows me a completely different one. Which one
is right and why?


The answer is yes. Both.

Nearly every PC goes through some router that provides NAT (Network address translation)

If your ifconfig/ipconfig shows a address such as
  • 192.168.*.*
  • 172.16.*.*
  • 10.*.*.*
  • then something is doing NAT

    In general, you don't need to know, your machine's address is just a placeholder until it gets out to the router, which converts the address to some other one.

    When you connect to a generic Internet host, say google.com it sees your address as that of the NAT box, it doesn't see into your local zone
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: IP address of my computer