Ask Leo!

Why doesn't my machine's IP address match what I'm told on the internet?

Home » Networking

Using tools on my machine, I can see that my IP address is one thing, in my case 192.168.1.100. But when I go to an internet site that shows me my IP, it shows my something completely different. Which is right?

The answer won't clarify anything, but I'll tell you anyway.

They're both right.

No, your machine doesn't really have two IP addresses, but the IP it shows as depends on who's looking, and from where.

What you're seeing is the result of what's called a NAT router. NAT stands for "Network Address Translation". The router manages the IP addresses on a LAN, or Local Area Network, and then translates to the appropriate IP address it was assigned on the external network, usually the internet.

Let's back up and look at how IP addresses are assigned.

In most cases, internet addresses are assigned dynamically:

Simple DHCP assignment

In this example, using a protocol called DHCP, for "Dynamic Host Configuration Protocol", when the computer connects to its ISP or network provider, it asks for an IP address, and that IP address is then assigned by the ISP. It's that IP address that the computer will be identified by on the internet. The IP address may change - the next time the computer connects it may be given a different address - hence this is called a "dynamic" IP address.

A static IP address is assigned ... well, statically. There is no request. Both the computer, and the ISP, are simply configured manually to "know" the IP address, and the computer that it refers to:

Simple Static assignment

There's no request or response involved. (I'll now leave static IP assignments behind. Most of the rest of this applies equally well to static and dynamic assignment, except in the details of how the IP addresses are actually assigned. Dynamic is what most situations we're trying to clarify here involve.)

Now let's insert a router into the mix. It sits between the computer and the rest of the network. It requests an IP address of your ISP using DHCP:

Router requesting an IP address

Note that the router asked for, and got, an IP address like any other, that now identifies it on the internet.

Now, your computer behind the router, must also ask for an IP address:

PC requesting an IP address from a router

The computer makes its request of the router this time, and receives an IP address back from the router. Note that the "192.168." address is special - you'll never see that on the internet, those are reserved for local networks, like the one we're building. In fact, if you connect a second computer to your router, you are in fact building a local area network:

Two PC's requesting IP addresses

Note that the two computers each have a unique IP address assigned from the router.

Now, what happens one of those computers makes a request that accesses the internet? The computers get to the internet through the router, so the first step looks like this:

PC making internet request

The router must then pass on that request to the internet:

PC making internet request

Notice: to the internet, it "looks like" the router is making the request. Remember, the internet cannot see your internal IP addresses, so the router translates from the internal address (192.168.1.100) to the external (1.2.3.4 in this example). When the response arrives, the same translation happens, in reverse:

Response heading back to PC

The router keeps track of which of the computers on the LAN side the request belongs to, and routes the response appropriately.

One of the side effects of using a NAT router in this manner is that regardless of which local computer on your LAN the request came from, to the internet it all "looks like" it came from your router. In our example, even if there were 100 computers on our LAN, all the requests made of the internet would look like they came from "1.2.3.4". Because they did.

So if you're behind a router, let's look at your local computer's assigned IP address. I like to do this from a command prompt: click Start, Run, type "CMD" and press OK, then in the resulting Command Prompt window type ipconfig followed by enter:

C:\Documents and Settings\LeoN>ipconfig

Windows IP Configuration


Ethernet adapter Wireless Network Connection:

        Connection-specific DNS Suffix  . :
        IP Address. . . . . . . . . . . . : 192.168.1.106
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.1.1

There you can see that this machine's IP address is 192.168.1.106. But if, on that same machine, I visit http://www.whatismyip.com, I get told a completely different number: "Your IP Is 206.124...." (truncated for privacy). That's the IP address of my router, on the internet. Regardless of what the IP address of the machine on my local network, on the internet I "look like" that one IP address.

There are other side effects as well, and I'll cover those in future articles.

Related:

Article 9639 | Posted December 30, 2005

Recent Comments

I got quite good knowlege from this article but my problem is i wana use ftp and due to router or seomthing my comp get a local id. how can a user at other end acces my server.

Posted by: Rakesh at January 24, 2006 02:34 AM

Zane: this requires that you know what ports you need to use, and then configure the router to forward those ports to the specific computer you want to access. You would use your IP address as it appears on the internet.

Posted by: Leo at January 24, 2006 10:06 PM

Could anyone help me with a problem i have. I have the same physcial network topology as the one shown in the tutorial above but the problem is that my pc is receiving the same ip address as the router-ie its not getting a lan ip address.Does this mean that my pc is not 'sitting' behind my router and that my pc could be exposed?

Posted by: Shane at February 16, 2006 03:47 AM

Yes. It sounds like your machine isn't behind your router at all. Check the topology in this article: http://ask-leo.com/how_should_i_set_up_my_home_network.html

Posted by: Leo at February 18, 2006 07:57 PM

hi i have similar problem as stated above..i want to stream my media over internet using windows media encoder and the url address to connect to my stream is http://10.1.1.12:8080 where 10.1.1.12 is static ip from LAN and 8080 is port i am using for straming..i already opened this port in my router .but i am confused with my url address as someone on other end cann't access my stream with this url.and i tried to the dynamic ip given to me by my isp(http//:203.X.X.X:8080) and its not working aswell..my question is how can someone on other end can access my computer and what url they need for it?

Posted by: Manni at February 28, 2006 02:55 AM

hi
how can i send my message to all user .
i want to know some funny tips and tweaks about Lan.

Posted by: tariq at April 28, 2006 03:54 AM

I would like to use netmeeting to "ring" my home PC being behind NAT router. Normally, I would use an IP to do that. However in this case, it won't for obvious reasons. Is there a way how to solve this?

Posted by: Radko Purm at February 6, 2007 11:42 PM

i've set a apache server on my machine..i'm usin' a router to connect the internet...i'm trying to connect to the server usin' the i.p. address given from the internet..i understood that this is the router i.p. address..but how can i link to the server that is on my computer?!

Posted by: tal at May 30, 2007 06:26 AM

I have a problem with my email system,, probably stmming from spam spewing from my "internet server". The 1.2.3.4 is what has been blocked by spamcop. But I have a "static" IP assigned by the ISP (or I thought). I therefore cant send out emails, they just bounce.
I connect to the net through a telephone line, using ADSL US Robotics Modem. Though it is said to be secure, I haven't heard tme to explore how I would avoid such problems with it. The machine has been running Kaspersky internet security, and am now trying AVG Internet Security, but all havent yet managed to stop the problem of almost 2 months now.
How may I sort my self out once and fo all?

Posted by: Robert Mutyaba at May 9, 2008 10:14 AM

I knew how these work; I stumbled upon this by accident. I'd like to say though, kudos on the CLEAREST explanation I've EVER seen on this topic. You really managed to break it down just right for people.

Keep it up!

Posted by: glacialfury at September 11, 2008 01:05 PM

Post a comment on "Why doesn't my machine's IP address match what I'm told on the internet?":






(Email Address will not be published.)

Remember Me?

By popular demand...
my tip jar
Cuppa Joe
Buy Leo a Latte!

(you may use HTML tags for style)

New!

RSS feed Subscribe to the RSS Feed specifically for comments on this article.

Before commenting, please...

Please wait. Your comment is being processed ...


Ask Your Question:


ask-leo.com
Web

Stay Informed

Weekly Newsletter

Archives

By Category
By Date

Advertisers

Advertise on Ask Leo!

««   »»

Question? - Ask Leo!
Who is Leo?
Link to Leo!

Terms, Conditions & Privacy