Linux Networking Basics for DevOps Engineers

If you canβt debug the network, you canβt survive in DevOps.
Linux networking is one of those skills that separates beginners from real engineers. Whether you're debugging a failed API, fixing a Kubernetes cluster, or checking server connectivity β these commands are your weapons.
Letβs break them down in a clean, practical, real-world way.
π§ 1. Understand Your Machine (IP & Interfaces)
π Command:
ip a
π What it does:
Shows all network interfaces and IP addresses.
π§Ύ Example Output:
eth0: inet 192.168.1.10/24
lo: inet 127.0.0.1
π§ Diagram:
[Your Machine]
|
|-- eth0 (192.168.1.10)
|-- lo (127.0.0.1)
π Shortcut:
hostname -I
π 2. Check Connectivity (Ping)
π Command:
ping google.com
π What it does:
Checks if your system can reach another server.
π§ Diagram:
[You] ---> ---> ---> [Google Server]
(ICMP packets)
π Limit packets:
ping -c 4 google.com
π£οΈ 3. Routing Table (Where traffic goes)
π Command:
ip route
π What it does:
Shows how your system sends traffic.
π§ Diagram:
Destination Gateway
0.0.0.0 -----> 192.168.1.1 (Router)
π Meaning:
Default traffic goes through your router
π 4. DNS Resolution
π Command:
nslookup google.com
π Better:
dig google.com
π§ What happens internally:
google.com β DNS Server β IP Address β Connect
π§ Diagram:
[You] β [DNS Server] β [Google IP]
5. Check Open Ports (Very Important π₯)
π Command:
ss -tuln
π What it shows:
Open ports
Running services
π§ Example:
LISTEN 0 128 0.0.0.0:80
π Meaning:
- Port 80 (HTTP) is open
π Check specific port:
ss -tuln | grep 80
π 6. Test Port Connectivity
π Command:
nc -zv google.com 80
π§ Diagram:
[Your System] ---> [Server:80]
(Check if open)
π Output:
Connection successful
π‘ 7. Trace Network Path
π Command:
traceroute google.com
π What it does:
Shows each hop between you and destination.
π§ Diagram:
[You]
β
[Router]
β
[ISP]
β
[Google]
π Faster alternative:
tracepath google.com
π₯ 8. Test APIs / Download Data
π Command:
curl -I google.com
π What it does:
Fetches HTTP headers (used in API debugging)
π Download file:
wget https://example.com/file.zip
π 9. Monitor Network Traffic
π Commands:
iftop
nload
vnstat
π§ Diagram:
Incoming ββ Outgoing Traffic
[ Real-time Monitoring ]
π 10. Check Which Process is Using a Port
π Command:
lsof -i :80
π Use case:
π "Which app is running on port 80?"
π§± 11. Firewall Management
π Ubuntu:
ufw status
π Allow port:
ufw allow 80
π CentOS:
firewall-cmd --list-all
βοΈ 12. Restart Network Service
π Ubuntu:
sudo systemctl restart networking
π CentOS:
sudo systemctl restart network
π₯ Real DevOps Scenario (Important)
π Problem: Your app is not accessible.
π§ Debug Steps:
ip a β Check IPping β Check connectivityss -tuln β Check port open?lsof -i β Check processcurl β Test APIufw status β Firewall issue?
π‘ Final Thoughts
Linux networking isnβt about memorizing commands β
itβs about thinking like a system.
Once you understand:
How packets move
How DNS resolves
How ports listen
π You can debug almost anything.
Connect With Me π€
If you found this article helpful and want to follow my DevOps learning journey, feel free to connect with me on the platforms below where I regularly share DevOps tips, tutorials, and practical learning experiences.
π Blog
https://devopsjourneywithrahul.hashnode.dev/
πΈ Instagram
https://www.instagram.com/devopsjourneywithrahul/
βΆ YouTube
https://www.youtube.com/@devopsjourneywithrahul
Let's continue learning and growing together in the DevOps journey π
π‘ If this article helped you, consider sharing it with someone starting their DevOps journey.





