Network Bytes · Episode 5 · CCNA 1.7

Public vs private IP

Google has never seen your laptop's IP address. Here's the difference between private addresses inside your home and the one public address the internet sees.

Posted · About a 1 minute watch, 2 minute read · Take the quiz

Private addresses stay inside

In the IP address lesson you saw an address like 192.168.1.25. That's a private IP address. A few ranges of numbers are set aside for use only inside homes, schools and offices:

  • 10.0.0.0 to 10.255.255.255
  • 172.16.0.0 to 172.31.255.255
  • 192.168.0.0 to 192.168.255.255

Routers on the internet won't carry traffic addressed to these numbers. That's why millions of homes can all use 192.168.1.25 at the same time without clashing.

Your home's public address

To reach the rest of the internet, your home needs an address the world can see: a public IP address. Your internet provider gives you one, and it's unique on the whole internet.

Think of an apartment building. Every building has an apartment 4B, so "4B" alone means nothing to someone across town. What they need is the building's street address. Your private addresses are the apartment numbers; your public address is the street address.

The router's swap

When your laptop opens a website, the request leaves with your laptop's private address on it. Your router swaps that for your home's public address before sending it out, and remembers which device asked. When the reply comes back, the router swaps it back and hands it to your laptop.

Because of this swap, every phone, laptop and TV in your home shares one public address. It's one of the main reasons the internet hasn't run out of IPv4 addresses.

Try it yourself

Find your private address: on an iPhone, open Settings > Wi-Fi and tap your network; on Windows, run ipconfig; on a Mac, hold Option and click the Wi-Fi icon. It probably starts with 192.168 or 10.

Then search "what is my IP" on the same device. The number you see is your home's public address, and it's different.

Good to know

  • The full private ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918). The video names the two you'll see most at home.
  • The router's swapping has a name: NAT, Network Address Translation. It gets its own lesson later.
  • Some internet providers add a second layer of sharing (called CGNAT), so even your "public" address may be shared with neighbors. That's beyond this lesson.

For CCNA learners

This lines up with CCNA 200-301 exam topic 1.7, describe the need for private IPv4 addressing: know the three RFC 1918 ranges and why NAT lets many private hosts share public addresses.

Test your knowledge

Quick quiz: Public vs private IP

4 multiple-choice questions. Pick one answer for each, then check how you did.

1Which of these is a private IP address?
2Who gives your home its public IP address?
3What does your router do when your laptop visits a website?
4In the apartment building example, what is the public IP address like?

Sources

Video transcript

Google has never seen your laptop's IP address. Not once.

That's because your home uses private addresses. Numbers that start with 192.168, or 10, are reserved for use inside a home or office. They never travel out on the internet.

Think of an apartment building. Every building has an apartment 4B, so 4B alone means nothing to the outside world. What the world sees is the building's street address. Your internet provider gives your home one of those: a public IP address.

When your laptop visits a website, your router swaps its private address for your one public address, then swaps it back when the reply arrives. That way, every device in your home shares one public address.

Private inside, public outside. That's how billions of devices fit on the internet.