Reputation: 59
If I type ipconfig in my system, I am getting an ip address which is different from what I get from google(what is my ip). Which IP address needs to be considered?
Upvotes: 2
Views: 1049
Reputation: 4937
The ipconfig
command on Windows provides the actual address used by the computer.
Address given by 'what-is-my-ip' tool is the publicly advertised address of either the Proxy server or the Gateway Router via which the computer connects to the Internet.
{ Internet } --> what-is-my-ip sees
+ all computers behind gateway
| as 54.102.3.209
|
|
| 54.102.3.209 --> Public address of Gateway
+------+------+ Advertised to the internet
| Gateway |
| Router | --> NAT is performed by Gateway
+------+------+
| 10.1.1.254 --> Internal address known to LAN
|
|
+-----------+----------+
| | |
+---+---+ +---+---+ +---+---+
| host 1| | ..... | | host n|
+-------+ +-------+ +-------+
10.1.1.15 10.1.1.101 10.1.1.4 --> Actual addresses of computers in LAN
(shown by ipconfig)
IP Address uniquely identifies the computer in a network.
There are 2 kinds of addresses:
Public (Globally unique and need to be purchased),
Private (Locally unique and free) (10.x.x.x, 172.16.0.0 to 172.31.255.255, 192.168.x.x)
It is usual practice for LANs (local area networks) to have private addresses for all computers, and only one public address for the Gateway Router.
This method of using private addresses for all computers and only one public address for Gateway provides these 2 major benefits:
Cost of owning IP Addresses can be reduced (all private addresses are free)
Depletion of IP addresses can be controlled (Every device on Internet cannot get a unique public address, as the number of addresses supported by IPv4 format is far lower than the number of devices connected to the Internet)
Gateway Router is the device that connects the LAN or groups of LANs to the Internet. The Gateway needs to have a public address, in order to allow the internet hosts to reach it.
The Gateway router uses the technique of Network Address Translation (NAT) to allow the computers behind it, which have private addresses, to reach the internet, via the gateway.
The internet sees the address of Gateway Router as the IP address of all computers with private addresses that are behind it.
Upvotes: 6
Reputation: 238
If you type ipconfig you get your local address, which is typically not the public address seen on the Internet. Just to explain you that, take a look at this picture:
https://www.devadmin.it/wp-content/uploads/2018/07/072418_1033_Accessoremo1.png
What does it mean? You have an address to talk to your router. Your router has another address to talk to your Internet Service Provider.
Typically, there are different scenarios, based on how the Internet Service Provider manages the IPs on the public Internet.
You can have a dynamic IP assigned only to your router. Please, take a look at the following image: https://www.devadmin.it/wp-content/uploads/2018/07/072418_1033_Accessoremo3.png
You can have a dynamic IP shared with other routers. Please, take a look at this image: https://www.devadmin.it/wp-content/uploads/2018/07/072418_1033_Accessoremo4.png
You can have a static IP. It means that your Home network is always reachable from outside with that IP. This typically needs a special contract with you ISP and you may pay more money to have this contract. Please, take a look at this image: https://www.devadmin.it/wp-content/uploads/2018/07/072418_1033_Accessoremo2.png
When I say Dynamic IP, it means that your ISP can dynamically assign an IP on the Internet every time you connect to the Internet.
You should think about your internal IP as the room in your house where you are located (bedroom or kitchen) and your ISP's IP assigned to you is the building where you live (a street address).
If you live in a condominium, different people can have your same address.
In that case, think about the IP between your ISP and your router as the apartment number.
Your ISP knows the number of your apartment and knows how to deliver messages to you, no matter if you are in the bedroom or in the kitchen.
It is your private router that knows in which room of the apartment you are. Think about rooms as the devices you have in your flat (Computer, Tablet, Smartphone, etc.).
Your device only returns by ipconfig its actual IP address, not the public IP.
Sites like "What is my IP" cannot read your device internal IP and they see your public IP on the Internet.
Sorry for the examples, but I think this is a good way to understand the topic.
Upvotes: 0
Reputation: 577
ipconfig returns your local ip address. May be you are in some local network and connected to ani switch or router or mikrotik.
Ip address is returned from "what is my ip" is the ip addres of this router/switch/mikrotik.
Upvotes: 1