Public and private IP address explanation with example and real time scenarios.
Public IP Address:
Public IP Address is the IP that is unique and visible to the world. For example, “interviewsansar.com” website has a unique public IP address. Actually, Public IP addresses are registered by Internet standards groups e.g. NIC (Network Information Centre) and IANA. and are assigned to the Internet Service Providers (ISPs) or other organizations.
Private IP Address:
A private IP address is the IP that is assigned to a device on a private TCP/IP Local Area Network. And these IP addresses are accessible only within the Local Area Network. For example, in home network and in an organization. NIC has reserved certain IP addresses that will never be registered publicly. These IP addresses are known as Private IP Address. Private IP Address ranges are below.
- 10.0.0.0 to 10.255.255.255
- 172.16.0.0 to 172.31.255.255
- 192.168.0.0 to 192.168.255.255
Public and Private IP address – Simple Real time scenario:
For our home network, we get an internet connection from an ISP (Internet service provider). And ISP provides us an IP address that is public IP Address. This public IP Address is unique across the world as two computers cannot have same IP address.
In our home, we may want to connect multiple devices e.g. mobiles, tablets and laptops etc. to the internet. How can we connect these devices as no two devices can have same IP address and ISP has provided only one IP Address? Here, Private IPs come in to picture. We use a Router that provides private IP addresses to these devices. Once you installed and configured Router with the public IP address provided by ISP then it will start assigning Private IP address to devices, if you connect it via Wi-Fi or cable to router and access internet.
- All devices connected to internet are recognized to the world by only Public IP Address.
- If we want to check if it is private IP, on your mobile go to WiFi setting and touch network name. it will show private IP address that must lie in the above mention Private Address range.
- Private IP Address can be configured in Router setting.