Private vs. Public IPv4 Addresses – Detailed Explanation
Definition of Public IP Addresses
A public IP address is an IPv4 address that is globally unique and assigned for use on the public Internet. Public IPs are routable across the Internet, allowing any device anywhere to connect (unless blocked by firewalls or ACLs).
These addresses are allocated and managed by Internet Service Providers (ISPs), which receive blocks from regional Internet registries (RIRs) such as ARIN, RIPE, or APNIC.
Example: A company hosting its website at 203.0.113.25
uses a public IP reachable from anywhere on the Internet.
Definition of Private IP Addresses
A private IP address is an IPv4 address reserved for internal use within a private network. These addresses are not routable on the public Internet, meaning routers do not forward packets with private source or destination IPs over the Internet.
Private IPs are used in homes, offices, campuses, and other organizations to address devices locally.
Example: Your Wi-Fi router might assign 192.168.1.100
to your laptop and 192.168.1.101
to your phone—both are private IPs.
Private IP Address Ranges (RFC 1918)
Class | Address Range | Subnet Mask |
---|---|---|
A | 10.0.0.0 – 10.255.255.255 | 255.0.0.0 (/8) |
B | 172.16.0.0 – 172.31.255.255 | 255.240.0.0 (/12) |
C | 192.168.0.0 – 192.168.255.255 | 255.255.0.0 (/16) |
Any IP within these ranges is non-routable on the public Internet.
Differences Between Public and Private IPs
Criteria | Public IP Address | Private IP Address |
---|---|---|
Scope | Global; Internet-wide | Local; internal to a network |
Routability | Routable on the Internet | Not routable on the Internet |
Assignment | By ISPs or RIRs | Set by network admin or via DHCP |
Security | Directly exposed unless protected by firewalls | Hidden from Internet by default |
Uniqueness | Must be globally unique | Only unique within local network |
Use Cases for Private IP Addresses
- Home/Office Networks: Devices like PCs, printers, IP phones use private IPs for local communication.
- Large Enterprises: Internal servers and endpoints use private IPs; edge devices like firewalls use public IPs.
- Devices Without Internet Needs: Printers, IoT devices, security cameras may only require private IPs.
Example: An office LAN with 50 computers using 192.168.10.0/24
, and a single public IP on the Internet gateway.
Network Address Translation (NAT)
Role: NAT translates between private and public IP addresses, enabling multiple devices on a private network to share one public IP for Internet access.
Types of NAT
- Static NAT: One-to-one private-to-public IP mapping.
- Dynamic NAT: A pool of public IPs mapped dynamically to private IPs.
- PAT (Port Address Translation): Many-to-one mapping using ports (also called NAT overload; common in homes/offices).
Example: Router translates traffic from 192.168.1.10
to public IP 203.0.113.10
using PAT.
Security Considerations
- Private IPs add security by hiding devices from direct Internet access.
- Firewalls typically filter and inspect traffic between private and public networks.
- NAT alone is not a security measure; use strong passwords, firewalls, and updates.
IPv4 Address Exhaustion and Private IP Usage
With only ~4.3 billion IPv4 addresses available, private addressing and NAT conserve public IP space by allowing many devices to share private ranges without conflicts.
Limitations of Private IP Addresses
- Not routable on the Internet — communication with external hosts requires NAT.
- Address conflicts can occur if two merged organizations use overlapping private ranges (e.g., both using 192.168.1.0/24).
IPv6 and Addressing Changes
IPv6 reduces the need for NAT by providing globally unique addresses for every device. However, IPv6 also defines Unique Local Addresses (ULA, fc00::/7) for internal use, somewhat analogous to private IPv4 addresses.
Key Points & Exam Tips
- Public IPs are globally routable and assigned by ISPs; private IPs are local and non-routable.
- Private IP ranges:
10.0.0.0/8
,172.16.0.0/12
,192.168.0.0/16
. - NAT is essential for Internet access from private IP networks.
- Private IPs cannot be used for Internet-facing services.
- Distinguish public vs. private IPs in exam questions.
- IPv4 exhaustion is a key reason for private addressing and NAT.
Example Scenario
John’s Home Network: His laptop has IP 192.168.1.10
and phone has 192.168.1.20
. Both connect to the Internet via his home router, which holds a public IP assigned by the ISP, e.g., 41.222.33.99
. NAT translates all local traffic to appear from this single public IP.