How to understand public vs private IP addresses

· Category: Networking

Short answer

Public IP addresses are routable across the internet and uniquely identify devices globally. Private IP addresses are used within local networks and are not reachable directly from the internet.

Key differences

  • Scope: Public IPs work worldwide. Private IPs work only inside a local network.
  • Uniqueness: Public IPs must be globally unique. Private IPs can be reused across different LANs.
  • RFC 1918 ranges: Private ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16.
  • NAT: Network Address Translation allows multiple private devices to share a single public IP.

When to use each

  • Use public IPs for web servers, VPN endpoints, and any service that must be reachable from the internet.
  • Use private IPs for internal workstations, printers, IoT devices, and database servers behind a firewall.

Why it matters

Private IPs conserve the limited IPv4 address space and add a layer of security by hiding internal topology. Understanding the distinction is essential for firewall rules, port forwarding, and remote access configuration.