Differences

Compared

Public vs private IP address

A private address comes from three ranges anyone may use inside their own network: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. It is never routed on the internet. A public address is unique on the internet and reachable from it. Devices with private addresses reach the internet through NAT, behind a public one.

Side by side

Public addressPrivate address
Ranges The rest of the assigned address space10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
Unique Across the whole internetOnly inside one network: two homes can both use 192.168.1.10
Routed on the internet YesNo
Handed out by Your provider, from a regional registry's blocksWhoever runs the network, usually its router's DHCP
Reaches the internet DirectlyThrough NAT on a router that has a public address
Reached from the internet Directly, where a firewall allows itOnly through a port forward on that router

Each one explained

Private addresses
Address ranges any organisation may use inside, never routed on the internet: 10/8, 172.16/12, 192.168/16.
IP address
A device's address across networks: 32 bits, written as four numbers like 10.0.1.10.
NAT
A router rewriting addresses as packets pass, usually to hide many private devices behind one address.
Port forward
One port on the router's public address passed to one device and port inside.

See the difference on real machines

Each lab is a small network of real Linux machines in your browser.

Open Public and private IP addresses: how two homes use one address

Sources

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab