Fundamentals
Networking Basics
How computers talk to each other β IP addresses, DHCP, NAT, SSH tunnels, SCP file transfers, and VM networking. The concepts every engineer needs to understand.
7 sections
networking essentials
~30 min
estimated reading
Beginner
no prerequisites
192.168.1.6192.168.1.10192.168.1.15074.83.52.19What is a Network?
A network is two or more computers connected so they can talk to each other. Your home WiFi is a network β your phone, laptop, and TV are all connected to the same router and can communicate.
Every device on a network gets an IP address β a unique number that identifies it, like a house address on a street. Without it, devices wouldn't know where to send data.
Think of a network like a neighborhood. Every house (device) has a unique street address (IP address). When you send a letter (data), you write the destination address on it. The postal service (network) delivers it to exactly the right house. Without addresses, letters would just get lost.
Every Packet Has a Destination
When you watch YouTube, your computer sends thousands of tiny packets of data. Each packet has a destination IP address (YouTube's server) and a source IP address (your device). The network routes each packet to the right destination β like a postal system for data.
Your Home Network
Your phone, laptop, and TV connected via WiFi router. Private, local, only visible inside your home.
Company Network
Hundreds of computers, servers, and printers connected in an office. Managed by IT professionals.
The Internet
The world's largest network β millions of computers all connected, talking to each other globally.
Key Takeaway
A network is computers connected together to share data. Every device gets a unique IP address β like a house address β so data knows where to go. Your home WiFi is a network. The internet is just a massive global network of networks.
Private vs Public IP Addresses
There are two types of IP addresses, and understanding the difference is fundamental. Private IPs are used inside your home network. Public IPs are your identity on the internet.
Private IP Address
A private IP address is used only inside your local network (like your home WiFi). Devices on the same network use private IPs to talk to each other.
Common private IP ranges
192.168.x.xMost home routers use this range10.x.x.xCommon in companies and offices172.16.x.xLess common, but also private- Assigned by your router automatically (using DHCP)
- Only visible to devices on the same network
- Cannot be reached from the internet
- Changes when you connect to a different WiFi
Router (192.168.1.1)
β
ββββββββββββββββΌβββββββββββββββ
β β β
Mac (.1.6) iPhone (.1.10) TV (.1.150)
Every device gets a unique last number.
They can all talk to each other using these addresses.Public IP Address
A public IP address is your identity on the internet. The entire world can reach you through it.
- Assigned by your ISP (Internet Service Provider β like AT&T, Comcast, Verizon)
- Only your router has a public IP β your individual devices do NOT
- Shared by all devices in your house
- Can change periodically (your ISP may reassign it)
Did You Know?
Search βwhat is my ipβ on Google to see your public IP address β it's what every website and server sees when you connect to them. Your phone and laptop both appear to come from the same public IP when they're on your home WiFi.
Private vs Public IP
| Feature | Private IP | Public IP |
|---|---|---|
| Visibility | Only inside your local network | Visible to the entire internet |
| Assigned by | Your router (DHCP) | Your ISP |
| Who has one | Every device on your network | Only your router |
| Shared? | No β each device is unique | Yes β shared by all home devices |
| Changes? | When you switch WiFi networks | Periodically, ISP may reassign |
| Example | 192.168.1.6 | 74.83.52.19 |
Key Takeaway
Private IPs work inside your home (192.168.x.x) β every device has one. Public IPs work on the internet β only your router has one, shared by all your devices. Think of private IP as your room number and public IP as your house's street address.
Your Router & NAT
Your router is the bridge between your home network and the internet. It has two IP addresses β one for each side. And it uses a clever process called NAT to translate between them.
THE INTERNET YOUR ROUTER YOUR HOME NETWORK
βββββββββββββββββββ
β Public side: β
Google, YouTube ββββΊ 74.83.52.19 βββββΊ Mac 192.168.1.6
Netflix, etc. β β iPhone 192.168.1.10
β Private side: β TV 192.168.1.150
β 192.168.1.1 β
βββββββββββββββββββWhat is NAT?
Your devices can't talk to the internet directly β they only have private IPs that the internet doesn't understand. The router acts as a translator between private and public addresses. This process is called NAT (Network Address Translation).
Imagine a big company with hundreds of employees. They all work from the same office building (public IP). When they send a letter, it goes out with the company's address β not their personal home address. The company's receptionist (NAT) knows which employee each reply is meant for and routes it to the right desk (private IP).
NAT Step-by-Step: Searching Google
Here's exactly what happens when you search βwhat is Linuxβ from your Mac:
Mac (192.168.1.6) sends request to Router (192.168.1.1): "Hey router, I want to reach Google"
Router swaps the source IP. Changes "From: 192.168.1.6" β "From: 74.83.52.19". Sends the request to Google.
Google receives it, sends response back to 74.83.52.19. Google has NO idea 192.168.1.6 exists β it only sees the router.
Router receives the response, remembers "this was for the Mac". Forwards it to 192.168.1.6.
You see search results on your Mac. π
Did You Know?
All devices in your house share the same public IP. When Google sees a request from your house, it always sees 74.83.52.19 β whether it came from your Mac, iPhone, or TV. Your router keeps track of which device asked for what and routes replies correctly.
Your IP Changes With Every WiFi Network
When you connect to a new WiFi network, the new router assigns your device a new private IP. Your old IP is released.
At Home: Home router gives your Mac β 192.168.1.6 At Coffee Shop: Their router gives your Mac β 10.0.0.47 At University: Their router gives your Mac β 172.16.5.112 At Friend's: Their router gives your Mac β 192.168.0.23 Your MAC address (hardware ID) stays the same β only the IP changes.
Key Takeaway
Your router has two faces β a private IP for your home network and a public IP for the internet. NAT is the translation process that lets all your home devices share one public IP. Your private IP changes every time you connect to a new WiFi, but your hardware ID (MAC address) never changes.
DHCP β Auto IP Assignment
DHCP stands for Dynamic Host Configuration Protocol. It's the system that automatically assigns IP addresses when devices connect to a network. Without it, you'd have to manually type in an IP address every time you connected to WiFi.
Think of DHCP like a hotel receptionist. When you check in (connect to WiFi), the receptionist (router) gives you a room key with a room number (IP address). That room number is yours for your stay. When you check out (disconnect), the room number is freed up for the next guest. No need to choose your own room β it's all handled automatically.
How DHCP Works
Step 1: Your Mac connects to WiFi
Mac: "Hey, I'm new here. Can I get an IP address?"
Step 2: Router responds
Router: "Sure, you can use 192.168.1.6"
Step 3: Mac uses that IP until it disconnects
When you leave, the router reclaims that IP for
someone elseβ With DHCP
Connect to WiFi. IP is automatically assigned. Everything just works. You don't think about it.
β Without DHCP
You'd need to manually enter an IP address, subnet mask, gateway, and DNS server every single time you connected anywhere.
Key Takeaway
DHCP is the invisible system that automatically hands out IP addresses. Your router is a DHCP server β it manages a pool of IP addresses and assigns them to devices as they connect. This is why you never have to type in an IP address when joining WiFi.
VM Networking (UTM)
When you create a VM in UTM (or VirtualBox/VMware), it creates a tiny private network between your Mac and the VM β completely inside your machine. This is how you SSH into a VM even with no WiFi.
INSIDE YOUR MAC ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β β UTM Private Network (192.168.64.x) β β β β ββββββββββββββββ ββββββββββββββββββ β β β Mac side β βββββββΊ β Ubuntu VM β β β β 192.168.64.1 β β 192.168.64.4 β β β ββββββββββββββββ ββββββββββββββββββ β β β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ This network exists only inside your Mac. Works even with no WiFi. Never changes.
Your Mac Has Multiple IPs at Once
This surprises most people β your Mac can have several IP addresses simultaneously, each for a different network:
192.168.1.6β on home WiFi (changes per network)192.168.64.1β on UTM VM network (always the same)127.0.0.1β localhost (always, on every computer)Think of your Mac as a building with multiple entrances. One entrance faces your home WiFi (192.168.1.6). Another entrance faces the internal VM corridor (192.168.64.1). And there's a special door that only your Mac itself can use β localhost (127.0.0.1). All the same building, multiple addresses.
Your Learning Setup vs Real Job
| Your VM Setup | Real Job | |
|---|---|---|
| Server | Ubuntu VM on your Mac | Ubuntu in a data center or AWS |
| Server IP | 192.168.64.4 (UTM) | 10.0.1.54 (company VPC) |
| How you connect | ssh charith@192.168.64.4 | ssh charith@10.0.1.54 |
| Network | UTM private bridge | Company VPN or private cloud |
| The commands | Identical β | Identical β |
Key Takeaway
VM networking creates a mini private network entirely inside your computer. Your Mac and VM communicate through this internal network using IPs like 192.168.64.x. Everything you practice on your VM works exactly the same on real servers β the only difference is the IP address.
SSH & SCP β Remote Access
SSH (Secure Shell) lets you remotely control another computer by typing commands in your terminal. Everything is encrypted β nobody can eavesdrop. SCP (Secure Copy) uses the same SSH tunnel to transfer files.
Breaking Down the SSH Command
Click the Play button above to start!
Watch the commands execute step by step
SSH Command Breakdown
| Part | Meaning |
|---|---|
| ssh | The command β "open a secure encrypted connection" |
| charith | Username on the remote machine |
| @ | "at" β connecting these two pieces |
| 192.168.64.4 | IP address of the remote machine |
Your Mac Terminal Ubuntu VM ββββββββββββββββ encrypted tunnel ββββββββββββββββ β You type β βββββββββββββββββββββββΊ Commands run β β commands β HERE β β here β βββββββββββββββββββββββ Output sent β β β back β ββββββββββββββββ ββββββββββββββββ You type on your Mac, but everything runs on the VM.
SCP β Copying Files Over SSH
SCP uses the same SSH tunnel but sends files instead of commands:
Click the Play button above to start!
Watch the commands execute step by step
SCP Command Breakdown
| Part | Meaning |
|---|---|
| scp | Secure Copy command |
| -r | Recursive β copy entire folder and everything inside |
| ~/Desktop/Linux_Proj/ | Source: folder on your Mac |
| charith@192.168.64.4: | Remote machine (same format as SSH) |
| ~/projects/ | Destination: where to put it on the VM |
Warning
SSH is picky about file permissions on your private key files. If you get a βPermission deniedβ error, check that your ~/.ssh/ folder has permission 700 and your key files have permission 600. SSH refuses to work if these are wrong β it's a security feature.
Key Takeaway
SSH gives you an encrypted remote terminal into any machine. SCP copies files through that same encrypted tunnel. Together they let engineers manage servers, deploy code, and transfer files β all securely, from anywhere in the world.
Finding Your IP Address
Knowing how to find IP addresses is a core sysadmin skill. Different operating systems use different commands, and you'll use these constantly when working with servers and VMs.
On Linux (Ubuntu VM)
Click the Play button above to start!
Watch the commands execute step by step
On macOS
Click the Play button above to start!
Watch the commands execute step by step
Did You Know?
ip a works on Linux but NOT on macOS. ifconfig works on macOS and older Linux systems. On modern Linux, ip a is the preferred command. To find your public IP (what the internet sees), just search βwhat is my ipβ on Google from any device.
Quick Reference
Finding IP addresses on different systems
| System | Command / Method |
|---|---|
| Linux (Ubuntu) | ip a β look for 'inet' that is NOT 127.0.0.1 |
| macOS | ifconfig | grep 'inet ' β ignore 127.0.0.1 and inet6 |
| iPhone | Settings β WiFi β tap (i) next to network β IP Address |
| Your public IP | Search 'what is my ip' on Google from any device |
Common IP Address Cheat Sheet
| Address | What It Is |
|---|---|
| 127.0.0.1 | Localhost β any computer referring to itself |
| 192.168.1.1 | Typical home router address |
| 192.168.1.x | Devices on a typical home network |
| 192.168.64.1 | Your Mac on the UTM VM network |
| 192.168.64.4 | Your Ubuntu VM (verify with ip a on VM) |
| 10.x.x.x | Private IPs common in offices and cloud |
| 0.0.0.0 | "All interfaces" or "any address" in server configs |
Key Takeaway
Use ip a on Linux and ifconfig on macOS to find IP addresses. Always ignore 127.0.0.1 (that's localhost β the computer talking to itself). On Linux, look for the 'inet' line that isn't 127.0.0.1 β that's your real IP on the network.
Networking Basics Quiz
What is a private IP address?
Networking Flashcards
Click any card to flip and reveal the definition.