Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference private IP and public IP

Can anybody explain me why I got two different IP-addresses?

So if I type on terminal ipconfig I get my network information where my Ip-adress is like 192.168.###.###. So I know that this is in private IP-range (private IP).

But if I for example google after myipadress I got as result something like this: 84.112.###.###.

And this is in my opinion the public IP-adress and after the website information the location of the ip-address (ISP) is about 3.3 km away from my current location...

So what would you answer if somebody asks after your IP-address??? which one would you say to him?

And the second question (or my own opinion) how can I determine my public IP without googling? What is technique behind that?

I think thats easy for this kind of websites because they get of course your public IP in the IP-frame if you go on their website and therefore that is not a problem.

And finally why do I have a private address at all? I know behind a network/interface there can be about 255 devices. In this case my modem must be able to grant up to 255 devices to the internet by giving a private(dynamic) address to everyone. The last 3 numbers of the IP-address can differ.

Can I say that my wlan-modem is a router?

I'm really confused about the IP-adresses can anybody help me?

thanks before

like image 296
user1844505 Avatar asked Oct 10 '14 01:10

user1844505


2 Answers

  1. You would tell them the 84 address as this is what is visible to the world.

  2. The wlan-modem that you describe (it sounds like you are on a home network) acts as a translator between the one public address that your internet provider assigns you and the many devices in your house. You can usually point your web browser at the wlan-modem and it will tell you its public address. You would point your browser to http://192.168.XXX.YYY where XXX.YYY is what your computer lists as its gateway. In most cases it works like this: your computer's address is 192.168.1.100, and it will have a gateway of 192.168.1.1.

  3. Why private addresses? There are two reasons, first is your ISP has a limited number of public addresses that is can give out to users (and only wants to give you one), and second is that by putting your computer on a private network its not directly accessible to the internet (picture your computer behind a one way mirror). All non-private IP's are like phone numbers, they are unique, nobody else has your number, while private IP addresses act more like internal extensions in a business.

What's special about the private 192.168.XXX.YYY vs 84.5.XXX.YYY ranges? Nothing really, other than a group of people said this set of addresses isn't global and can be used privately. https://www.rfc-editor.org/rfc/rfc1918

The technical term for what your wlan-modem is "Network Address Translation" (NAT) device. This is a device that sits between a private and public network and rewrites network traffic to make everything look like it originated from one public address.

like image 184
Mike Avatar answered Sep 28 '22 00:09

Mike


Your modem (yes, you can call it a router) creates a private address space. Every device behind the router receives a private address in the 192.168.x.x network. 192.168 is a special address space reserved for private networks. (There are other blocks reserved for private networks, but your router uses 192.168, which is common.)

Your Internet Provider only allocates one public IP address to your router, which can then share it with all its connected devices. This strategy is called Network Address Translation.

It has a few purposes, some security-related, but the primary purpose of NAT is to allow multiple devices to share a single public IP address.

If someone is asking for your IP address, give them your public IP address if they are outside your network because that's what they see. Or if they are connected to the same router as you, they will want to know the private IP because that's what they see.

like image 31
Rocky Avatar answered Sep 28 '22 01:09

Rocky