Lesson: IP Addresses & How Machines Find Each Other
What you'll learn
- What an IP address actually is and why machines need one.
- The difference between a public and a private address.
- What "a network" means, and how a host knows whether a destination is local or remote.
- The role of the default gateway and DNS in getting a packet to its destination.
By the end you should be able to look at your own machine's address and explain, out loud, how a request to another machine leaves your box.
The lesson
1. The problem networking solves
A computer that wants to send data to another computer needs two things: a way to name the destination, and a way to deliver the data there. On the internet (and in our lab), the naming/delivery layer is IP — the Internet Protocol. Every machine that participates gets an IP address: a number that uniquely identifies it on its network.
Think of it like the postal system. The IP address is the street address on the envelope. The data you're sending is the letter inside. The network is the postal service that reads the address and moves the envelope hop by hop until it arrives.
2. What an IPv4 address looks like
The addresses you'll meet most often are IPv4 — four numbers (0–255) separated by dots:
10.100.100.7
│ │ │ └── host part (which machine)
└───┴───┴───── network part (which network) — see the next chapter
Each of those four numbers is one octet (8 bits), so the whole address is 32 bits. That gives ~4.3 billion possible addresses — which sounds like a lot until you realise how many devices exist. That scarcity is why we have private addresses (below) and, eventually, IPv6.
3. Public vs private addresses
Some address ranges are reserved as private — they're meant to be reused inside any organisation's own network and are never routed on the public internet:
10.0.0.0 – 10.255.255.255 (10.0.0.0/8)
172.16.0.0 – 172.31.255.255 (172.16.0.0/12)
192.168.0.0 – 192.168.255.255 (192.168.0.0/16)
Our lab lives entirely in private space: every VM sits on 10.100.100.0/24. For example:
Jumpbox 10.100.100.254 (the SSH entry point)
Git-Server 10.100.100.2
Docs-Server 10.100.100.3
Monitoring 10.100.100.4
k8s master 10.100.100.7
A public address is globally unique and reachable from the internet. Our lab reaches the outside world through a single public-facing gateway; internally, everything talks over private 10.100.100.x addresses. (Public addresses in these docs are shown as 203.0.113.x for privacy — that's a documentation range, not a real one.)
4. "A network" and the local-vs-remote decision
Machines aren't all on one giant network — they're grouped into networks (you'll learn exactly how in the Subnetting chapter). The key idea for now: when your machine wants to send a packet, the very first decision it makes is:
Is the destination on my own local network, or somewhere else?
Is the destination in MY network?
│
┌──────┴───────┐
YES NO
│ │
Deliver Hand it to the
directly DEFAULT GATEWAY
(same LAN) (the router out)
- Local → it sends the packet straight to that machine on the same network segment.
- Remote → it can't reach the destination directly, so it hands the packet to its default gateway (a router), trusting the gateway to forward it onward. In our lab the gateway for the VM network is the pfSense firewall/router.
This single decision — local or remote? — is the heart of IP routing, and you'll see it again in Docker networking and Kubernetes networking later.
5. Names, not numbers: DNS
Humans don't remember 10.100.100.3; we remember docs.example.com. DNS (the Domain Name System) is the phone book that translates names into IP addresses. When you type a hostname, your machine first asks a DNS resolver "what's the IP for this name?", then does everything above with the answer.
So the full journey of a typical request is:
name ──DNS──▶ IP address ──local/remote?──▶ deliver directly OR via gateway
6. See it on your own machine
On any Linux box (e.g. the Jumpbox), these commands show the concepts above:
ip addr # your interfaces and their IP addresses
ip route # your routing table — note the "default via ..." line (your gateway)
cat /etc/resolv.conf # which DNS resolver(s) you use
getent hosts docs.example.com # resolve a name to an IP
The default via <gateway-ip> line in ip route is the "remote → hand to gateway" rule from section 4, written down.
Dig deeper
- Cloudflare Learning — What is an IP address?: https://www.cloudflare.com/learning/dns/glossary/what-is-my-ip-address/
- Cloudflare Learning — What is DNS?: https://www.cloudflare.com/learning/dns/what-is-dns/
- RFC 1918 (the actual standard that defines private address ranges) — skim it to see what a real RFC reads like: https://datatracker.ietf.org/doc/html/rfc1918
- Cloudflare Learning — What is the Internet Protocol (IP)?: https://www.cloudflare.com/learning/network-layer/internet-protocol/
Search terms
Drop these into Google/YouTube when you want more depth:
what is an IP address explainedpublic vs private IP address RFC 1918default gateway explained networkinghow DNS resolution works step by stepip route default gateway linux
Check yourself
You understand this lesson when you can answer these without looking:
- What does an IP address identify, and how many bits is an IPv4 address?
- Name the three private IPv4 ranges. Which one is our lab in?
- When your machine sends a packet, what is the first decision it makes about the destination?
- What does the "default gateway" do, and when is it used?
- In one sentence, what problem does DNS solve that IP alone does not?
No comments to display
No comments to display