Skip to content

Public versus Private#

The Internet's IPv4 address space is split up into multiple "spaces." We're concerned with two of them: private and public. These are called IP address spaces.

A private address space cannot be routed over the public Internet. That means no system, anywhere in the world, can use a private address space IP address, such as, to advertise a system on the public Internet. If you ran a web server on such a system, with such an IP address, someone else could not access it over the public Internet without further work being done. That's because private address spaces are used for internal communications only, such as all the systems inside of your corporate or home networks.


You can configure your networking hardware to forward connections from a public IP to an internal, private IP, making it possible to host systems internally. That's actually the only way you can really do it, and we'll see this when we get into the AWS section.

A public address space is the opposite: it can be routable over the Internet but cannot be used for internal or private use cases (technically, it can be but let's keep this simple.) When you want a system to be available on the public Internet, you use the public address space.

What constitutes a private IP and what constitutes a public IP is well established theory. Let's look at that list of private IP address spaces.

These are the official private IP address space ranges:

CIDR Block Addresses IP Range 16,777,216– 16,777,216 – 1,048,576 – 65,536 –

You'll see the address space a lot in AWS environments. The address range is extremely common in private homes. Your own private IP at home is likely in the latter range. There are other private networks too, but these are the ones that you'll be concerned with the most. Everything else will likely be a public, Internet routable address.

With, you're going to see a lot, which is your local system, and localhost is the hostname that references

If we look at, we get a total of 16,777,216 IP address, but what does that mean, exactly? How do we get those addresses? Without going into the (complex) math involved, what we're essentially saying is: gives us a massive list of sixteen million IP addresses between and As a list, this would be huge, but here are the first five addresses, and the last five addresses:


These are valid private IPs we can use in our network.