Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Networking for Defenders  ›  Lesson

Public and Private IP Addresses

Public vs Private IP Addresses 15 minPrivate IP addresses are used inside a network and are not routed on the internet, while a public address faces the world, with the router as default gateway translating between them.

Public and Private IP Addresses

Priya's router settings page lists two very different addresses: 192.168.1.1 and 203.0.113.45. One is how devices in the shop find the router; the other is how the whole internet sees the shop. Knowing which is which tells you what the outside world can reach directly.

The rule

Private addresses stay inside; one public address faces the world.

An IP address identifies a device on a network. Some ranges are reserved as private: they are used inside homes and offices and are never routed across the public internet.

  • 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

Everything else that is routable is public. The router uses NAT (network address translation) to let many private devices share one public address when they go online.

A few more terms you will meet on every settings page:

  • Subnet mask or CIDR: says which part of the address is the network. 192.168.1.0/24, or mask 255.255.255.0, means the first three numbers are fixed, leaving 256 addresses, of which 254 can be given to devices.
  • Default gateway: the router address a device sends traffic to when the destination is outside its own network.
  • Loopback: 127.0.0.1, also called localhost, always means "this same machine". Traffic to it never leaves the device.

The shortcut

Look at the first numbers. 10, 172.16 to 172.31, or 192.168 means private. 127 means this machine. Anything else is public and potentially reachable from anywhere.

Reading the shop's networkStep 1 of 4
  1. The network

    Shop devices live in 192.168.1.0/24. That starts with 192.168, so it is private.

The trap is thinking "private" means "secure". Private addresses are only hidden from direct outside connections. A device inside can still be tricked into reaching out, so the other defences still matter.

Drills

Answer fast — trust the rule.

quick drill

Which address is private?

quick drill

What does 127.0.0.1 refer to?

quick drill

A device wants to reach a website outside the shop network. Where does it send the traffic first?

quick drill

How many addresses does a /24 network contain in total?

quick drill

Which statement about private addresses is true?

Remember

  • Private addresses stay inside; one public address faces the world through NAT.
  • 10, 172.16 to 172.31, 192.168: private. 127: this machine. The router is the default gateway.
  • Trap: treating "private" as "secure".

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainInside or outside?

The shop's router shows 192.168.1.1 on the inside and 203.0.113.45 on the outside. Explain what each address is, which one the internet can reach, and why being on a private address does not make the till completely safe.