π Short Intro (Why Iβm Writing This)
Iβm currently learning Networking for DevOps and decided to learn in public by documenting my journey.
This blog is part of my Networking 101 series, where Iβm learning Networking for DevOps step by step from scratch.
This series is not written by an expert β itβs a beginner learning out loud, sharing:
- what I understand,
- what confuses me,
- and what I learn along the way.
The goal is to build consistency, clarity, and invite discussion.
π What This Blog Covers
In this post, Iβll cover:
- IP Address, Local IP vs Internet IP
- Public IP vs Private IP
- Brief overview of NAT
- Ports
-
localhostvs127.0.0.1 - Few Basic commands
π GitHub Repository
All my notes, diagrams, and learning resources for this series live here:
π GitHub Repo:
https://github.com/dmz-v-x/networking-for-devops-101
This repo is updated as I continue learning.
π Learning Notes
1. What is an IP address (really)?
An IP address identifies a machine on a network.
Thatβs it.
Just remember this:
IP address = identity of a machine on a network
Examples:
192.168.1.10
10.0.0.5
13.234.56.78
Every machine that communicates on a network must have an IP.
2. Local IP vs Internet IP (very first distinction)
Your laptop has:
- One IP inside your local network
- Possibly another IP visible to the internet
Why? Because networks are layered.
Example:
Laptop β WiFi Router β Internet
Your laptop is not directly exposed to the internet.
3. Public IP Address (Internet-facing)
A public IP:
- Is unique on the internet
- Can be accessed from anywhere
- Is assigned by ISPs or cloud providers
Example:
13.234.56.78
Cloud servers usually have:
- A public IP (optional)
- A private IP (always)
4. Private IP Address (Internal-only)
A private IP:
- Works only inside a private network
- Cannot be reached directly from the internet
Common private IP ranges:
10.0.0.0 β 10.255.255.255
172.16.0.0 β 172.31.255.255
192.168.0.0 β 192.168.255.255
Your home WiFi, office network, and cloud VPCs all use private IPs.
5. Why private IPs exist
The internet does not have enough IPs for every device.
So:
- Private IPs are reused everywhere
- Public IPs act as gateways
This design allows:
- Security (not everything exposed)
- Scalability
- Cost efficiency
This leads us to a very important idea (weβll learn this concept later):
π NAT (Network Address Translation)
6. Tiny preview: What NAT does
NAT allows:
Many private IPs β One public IP
Your laptop sends traffic:
192.168.1.10 β Internet
The router translates it to:
Public IP β Internet
7. What is a port?
If an IP identifies a machine, a port identifies a program on that machine.
One machine can run many applications:
- Web server
- Database
- SSH
- Cache
Ports make this possible.
8. Port analogy (simple but powerful)
Think of:
- IP address β apartment building
- Port β apartment number
13.234.56.78:22 β SSH
13.234.56.78:80 β HTTP
13.234.56.78:443 β HTTPS
Same building, different doors.
9. Common ports every DevOps engineer must know
| Port | Purpose |
|---|---|
| 22 | SSH |
| 80 | HTTP |
| 443 | HTTPS |
| 3306 | MySQL |
| 5432 | PostgreSQL |
| 6379 | Redis |
10. How IP + Port work together
A network connection always needs:
IP address + Port
Examples:
ssh user@13.234.56.78 β port 22
https://example.com β port 443
localhost:3000 β port 3000
Without a port, the OS doesnβt know which app should receive the data.
11. localhost vs 127.0.0.1
When we run an application on our laptop, that's when localhost and 127.0.0.1 comes into picture.
11.1 What is 127.0.0.1?
127.0.0.1 is an IP address, specially it is called loopback IP which means if any network request sent to this IP it comes back to the same machine.
The request never leaves our machine, no router, no internet and no external network is involved.
11.2 What is localhost?
localhost is a hostname, it's not an ip. When we type localhost our operating system translates this name into an IP address that is 127.0.0.1
localhost β 127.0.0.1
This translation happens via
- /etc/hosts file (Linux/macOS)
- C:\Windows\System32\drivers\etc\hosts (Windows)
11.3 How does localhost actuallly works?
When we type: http://localhost:3000, internally our operating system follow these steps:
- OS sees
localhost - It looks up the hosts file
- Resolve it to an IP (usually
127.0.0.1) - Send the request to that IP
So the flow becomes:
localhost β 127.0.0.1 β your own machine
11.4 Are localhost and 127.0.0.1 same?
Short Answer: No
-
127.0.0.1is hard-coded as a loopback IP -
localhostis configurable
Our system can map localhost to something else
In many modern systems:
localhost β ::1
::1 is the IPv6 loopback address.
11.4 Which one should we use?
Use localhost when:
- Developing locally
- You don't care about IPv4 vs IPv6
Use 127.0.0.1 when:
- Debugging networking issues
- Want guaranteed IPv4
- Dealing with Docker, databases, or binding issues
11.5 A DevOps Example:
If our server logs say:
Listening on 127.0.0.1
That means:
- Only this machine can access it.
- Not accessible from other devices.
If it listens on:
0.0.0.0
That means:
- Accept connections from any network interface.
11.6 Complete flow
We type in browser:
`localhost`
β
OS resolves name
β
`127.0.0.1` or ::1
β
Request comes back to
your own machine
12. Classic DevOps failure example
Problem:
App works on your laptop but not on the cloud server.
Whatβs happening:
- App is listening on
localhost - Cloud traffic comes to public IP
- App never sees it
Fix:
- Bind app to
0.0.0.0 - Open the correct port
- Allow traffic in firewall/security group
Weβll fully break this down later.
13. Hands-on commands
13.1 Check your IPs
ip addr # Linux
ifconfig # macOS
13.2 See listening ports
ss -tuln
or
netstat -tuln
13.3 Test remote port
nc -vz 13.234.56.78 443
β Key takeaways
- IP address identifies a machine
- Port identifies an application
- Public IP β internet-facing
- Private IP β internal-only
-
localhostvs127.0.0.1 - Most DevOps bugs = wrong IP, wrong port, or wrong binding
π¬ Feedback & Discussion
π‘ Iβd love your feedback!
If you notice:
- missing tool categories,
- incorrect assumptions,
- or better learning paths,
please comment below. Iβm here to learn.
β Support the Learning Journey
If you found this blog useful:
β Consider giving the GitHub repo a star β
it really motivates me to keep learning and sharing publicly.
π¦ Stay Updated (Twitter / X)
I share learning updates, notes, and progress regularly.
π Follow me on Twitter/X:
https://x.com/_himanshubhatt1
π Whatβs Next
In the next post, Iβll be covering:
π TCP vs UDP (Connections, Reliability, and Why It Matters)
Iβll also continue updating the GitHub repo as I progress.
π Learning in public
π Repo: https://github.com/dmz-v-x/networking-for-devops-101
π¦ Twitter/X: https://x.com/_himanshubhatt1
π¬ Feedback welcome β please comment if anything feels off
β Star the repo if you find it useful
Top comments (0)