Sub topic 3
Public and Private IPv4 Addresses
Assume you understand basic IP addresses, subnet masks, and powers of two. This chapter focuses on how address ranges are used, not on calculating subnet masks from scratch.
Public and private addresses
A public address is globally unique and can be routed across the public Internet. A private address is intended for internal networks and is not routed across the public Internet.
Private addressing lets homes, offices, and cloud networks reuse the same address space. The address 192.168.1.10 can exist in millions of separate networks without causing a global conflict.
| Address type | Typical use | Internet-routable? |
|---|---|---|
| Public | Web server or router interface | Yes |
| Private | Laptop or internal server | No |
| Shared | Carrier-grade NAT between customers and an ISP | Not normally |
The three RFC 1918 private ranges
RFC 1918 defines these private IPv4 ranges:
10.0.0.0/8, from10.0.0.0through10.255.255.255172.16.0.0/12, from172.16.0.0through172.31.255.255192.168.0.0/16, from192.168.0.0through192.168.255.255
The prefix is important. 172.20.4.5 is private, but 172.32.4.5 is not in the RFC 1918 range.
How NAT reaches the Internet
Network address translation (NAT) changes packet addresses as traffic crosses a gateway. When a private host connects outward, the gateway replaces the private source address and often the source port with a public address and port. It records this mapping so reply packets return to the correct host.
Pitfalls and shared address space
Overlapping private networks create problems when you join them with a VPN or router. Two sites may both use 192.168.1.0/24, so a router cannot reliably distinguish the destinations. Renumbering or translation may be required.
ISPs may use carrier-grade NAT (CGNAT). The shared range 100.64.0.0/10 covers 100.64.0.0 through 100.127.255.255. It is reserved for communication between customers and their carrier’s NAT systems. It is neither RFC 1918 private space nor an ordinary public range.
Exercise
Is 172.32.0.1 an RFC 1918 private address, and why?
Show answer
No. The 172.16.0.0/12 range ends at 172.31.255.255.