Module 5: IP Addresses and Ports
Public and private addresses, and NAT
🏠The everyday picture
An office building has one street address, but inside, people have extension numbers: 101, 102, 103. Outsiders call the main number; the receptionist connects them to the right extension. Extensions 101 to 103 exist in thousands of other buildings too, and that's fine because they're only used inside.
📘What it really is
-
Private addresses are used only inside local networks and repeat in every home and office. They start with
192.168.,10.or172.16.to172.31.. -
Public addresses are unique on the whole internet. Your ISP gives your router one.
-
NAT (Network Address Translation) is the receptionist: your router swaps private addresses for its public one on the way out, and back again on the way in. That's how all your devices share one public address.
-
A side effect: devices outside can't reach your devices inside unless the router is told to allow it. This protects home devices, and it's another reason home computers make awkward servers.
-
A server on the internet has a public IP address so anyone can reach it.
🖱️Try it
Search "what is my IP" in your browser. The address shown is your public IP. Compare it with the private address from Lesson 1. They're different: that's NAT at work.
✅Quick check
Your laptop shows 192.168.1.24, but a website says your IP is 49.36.x.x. Which is which?
Show the answer
192.168.1.24 is your private address on the home network; 49.36.x.x is your router's public address that
the internet sees.
Can your neighbour's laptop also have the address 192.168.1.24?
Show the answer
Yes. Private addresses repeat in every local network.
