A public IP address is a gateway to the internet, but a private IP address is a walled garden within your network.
Let’s see this in action. Imagine your home network. Your router has a public IP address assigned by your ISP – this is its identity on the global internet. Your laptop, phone, and smart TV, however, all have private IP addresses. They can talk to each other and to the router, but they can’t directly talk to a server on the internet. The router acts as a translator, using a technique called Network Address Translation (NAT) to let your private devices access the internet.
Here’s how it breaks down:
Public IP Addresses:
- What they are: Globally unique and routable on the internet. Think of them as your home’s street address, visible to anyone.
- Ranges: There are no predefined "ranges" of public IPs in the same way as private ones. They are allocated by regional internet registries (RIRs) like ARIN, RIPE, and APNIC, and then distributed to ISPs. An ISP might have a block of thousands or millions of public IPs to assign to its customers.
- Use Cases:
- Internet-facing servers: Web servers, email servers, VPN endpoints all need public IPs to be reachable from anywhere.
- Direct internet connectivity: Any device that needs to be directly accessible from the internet without a NAT device in front of it.
- Businesses with dedicated static IPs: For hosting services, reliable remote access, or specific application requirements.
Private IP Addresses:
- What they are: Not routable on the internet. These are for internal network use only. They are like the room numbers within your house – only meaningful to people inside.
- Ranges: Defined by RFC 1918 and are guaranteed not to be routed on the public internet. There are three main blocks:
10.0.0.0to10.255.255.255(10.0.0.0/8) - A huge block, often used for large corporate networks or complex internal setups.172.16.0.0to172.31.255.255(172.16.0.0/12) - A medium-sized block, common for many businesses.192.168.0.0to192.168.255.255(192.168.0.0/16) - The most common range, especially for home routers and small office networks.
- Use Cases:
- Internal network communication: Devices on your home or office LAN talking to each other (e.g., printing to a network printer).
- NAT (Network Address Translation): This is the key. Routers use private IPs for internal devices and translate them to a single public IP when outgoing traffic hits the internet. This conserves public IP addresses, which are a finite resource.
- Security: By default, devices with private IPs are not directly accessible from the internet, adding a layer of security.
The magic that lets your internal devices reach the internet is NAT, most commonly PAT (Port Address Translation). When your laptop (say, with 192.168.1.100) sends a request to google.com, your router takes that packet, changes the source IP from 192.168.1.100 to its own public IP (e.g., 203.0.113.5), and also assigns a unique source port number. It then records this mapping (your internal IP and port to its public IP and a new port) in a NAT table. When Google’s server responds, it sends the packet back to your router’s public IP and that specific port. Your router looks up the port in its NAT table, sees which internal device initiated the request, and rewrites the destination IP back to your laptop’s private IP (192.168.1.100) and the correct internal port.
Many people configure their home router to use the 192.168.1.0/24 subnet for their wireless and wired devices, meaning all devices will get IPs like 192.168.1.2, 192.168.1.3, etc., with the router itself usually being 192.168.1.1. This is a convention, and you can actually change the entire private IP range your router uses. For example, you could configure your router to use the 10.0.0.0/24 range, and then your devices would get IPs like 10.0.0.2, 10.0.0.3, with the router at 10.0.0.1. As long as this private range isn’t directly routed on the internet and your router performs NAT, it works identically.
The next step in understanding network addressing is how these IPs are assigned and managed, leading into DHCP and DNS.