Skip to main content

Command Palette

Search for a command to run...

Linux Networking Basics for DevOps Engineers

Updated
β€’4 min read
Linux Networking Basics for DevOps Engineers
R
From learning basic computers in college to working in enterprise software. Now exploring DevOps, cloud, and automation while sharing the journey publicly.

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:

  1. ip a β†’ Check IP

  2. ping β†’ Check connectivity

  3. ss -tuln β†’ Check port open?

  4. lsof -i β†’ Check process

  5. curl β†’ Test API

  6. ufw 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.

Linux for DevOps Beginners

Part 8 of 8

This series documents my journey of learning Linux for DevOps. It covers Linux fundamentals, essential commands, file systems, permissions, processes, and system management concepts that every DevOps beginner should understand.

Start from the beginning

Why Linux Is Important For DevOps Beginners

In my previous blog, I shared how my journey in technology began β€” from not even knowing how to properly shut down a computer to starting my DevOps learning journey. But once I started exploring DevOp