# Private IPs, NAT and DHCP

> Why your laptop has a private address and your home has one public one. How NAT shares that address, and how DHCP hands out the rest.

**Course:** [Computer Networking](https://learn.benibix.com/learn/infrastructure-networking)  
**Time:** 12 min

**After this lesson you can:**

- Tell a public from a private IP address
- Explain how NAT lets a home share one address
- Say what DHCP does when a device joins

## How a whole home shares one address

A public IP address is one the whole internet can reach. Only one device may use it at a time. A private IP address only works inside a local network. Most homes get one public address from their provider. Every device inside gets a private one, and the router shares the public one between them.

Three blocks of addresses are set aside as private. They start with 10, with 172.16 to 172.31, and with 192.168. Any home or office may use them, and millions do at once. Routers on the internet will not carry them, so they never clash.

NAT, or network address translation, is how the sharing works. When your laptop sends a request out, the router swaps the private address for the public one and notes who asked. When the answer comes back, it swaps the address back and hands it to the laptop.

NAT has a side effect. A stranger on the internet cannot start a talk with your laptop, because the router has no note saying who should get it. That blocks a lot of unwanted traffic. It also means a server at home needs a rule in the router before anyone outside can reach it.

DHCP is the service that hands out the private addresses. When a phone joins the Wi-Fi, it asks for an address, and the router gives one from its block for a set time, often a day. It also tells the phone where the router is and which service to ask about names.

Servers usually skip DHCP. A server that moved to a new address every few days would be hard to find. So it gets a fixed address, either typed into the server or saved in the router for that machine.

People often think their public address is fixed. On most home plans it can change now and then, for example after the router restarts. That is fine for browsing, and a problem for hosting a site at home. Hosting providers give servers a public address that stays put.

![Inside a home network marked 192.168.1.0/24, three devices hold private addresses that the router handed out. One laptop has a small loop marked 127.0.0.1 that points back to itself. At the router, the private addresses are swapped for one public address, 203.0.113.7, which is the only address the internet sees.](https://learn.benibix.com/diagrams/inf2-addresses.svg)

### Example: A family of four online at once

A family has two laptops, two phones and a TV. The router hands them 192.168.1.10 to 192.168.1.14 as they join.

All five stream and browse at the same time. Every website they visit sees only the family's one public address, 203.0.113.7.

**Words in this lesson:** [Public IP Address](https://learn.benibix.com/term/infrastructure/public-ip-address), [Private IP Address](https://learn.benibix.com/term/infrastructure/private-ip-address), [Network Address Translation (NAT)](https://learn.benibix.com/term/infrastructure/network-address-translation), [Dynamic Host Configuration Protocol (DHCP)](https://learn.benibix.com/term/infrastructure/dhcp)

**Question:** Why can millions of homes all use the address 192.168.1.10?

**Answer:** Each home's router hides it behind one public address, and private addresses never cross the internet. Private addresses only work at home. The router swaps them for the one public address before anything leaves.

---

Source: https://learn.benibix.com/learn/infrastructure-networking/private-ips-nat-and-dhcp
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
