I’ve been diving into the public and private IP addresses, as I could understand public IP addresses are assigned by Internet Service Providers, but I couldn’t understand how and by whom are private IP addresses assigned. I couldn’t understand as well what’s the purpose of private IP addresses.
Any help is appreciated. Thank you for helping me out.
In: Other
Along with everything everyone else said, its important to know: there are not enough IP addresses (IPv4 specifically). There are only around 4.29 billion possible variations of an IP address, which is not nearly enough for the amount of people and devices in the world.
Private IPs are one solution to this problem. One building/company/group/etc will be assigned one public facing IP address, and everyone inside that network (known as Local Area Network (LAN)) will have their own private IP addresses assigned by the router. This usually starts with 192 or 172 or 10.
So everyone inside that building will have their own private IP, but when they connect to the internet they will all share the same public IP. If you’ve ever had a sibling get banned from a Minecraft server and it makes everyone else in the house banned too, this is why.
So how does the internet know how to serve webpages and info to your specific machine despite you sharing the same IP with others? Simply, the router keeps track of whos making the request out to the web page, so when it gets a response, it will remember that you made the request and direct it back to you.
If the the connection initiates on the outside (for example, if you’re hosting a Minecraft server and want people to connect to it), then you need to set up portforwarding on your router. This tells the router “hey, any connection to my public IP over the port [###] should get directed to my private IP specifically”. The router wouldn’t know where to direct that traffic otherwise.
Hope this makes sense. Also, if you’re curious, you can check your private IP by typing ipconfig in your command prompt, and you can check your public IP by going to whatismyip.com
Latest Answers