← Back to Home
🌐

Linux Networking

Inspect interfaces, test connectivity, and diagnose the network problems behind most production incidents.

⏱12 min readπŸ“šDevOps Fundamentals

Imagine a server that can’t reach another server: no websites, no Docker pulls, no GitHub access, no Kubernetes cluster. Networking is what lets computers communicate β€” and as a DevOps engineer you’ll troubleshoot it almost every day.


🎯 Learning Objectives

By the end of this lesson you will:


Your IP Address and Hostname

Every computer has an address and a name:

bash β€” 80Γ—24
student@devops:~$hostname && hostname -I

Network Interfaces

bash
ip addr    # show all network interfaces
ip a       # short form of the same command

Common interfaces you’ll see:

Interface Meaning
lo Loopback (the machine talking to itself)
eth0 Wired Ethernet
wlan0 Wireless

Testing Connectivity

Ping tests whether you can reach another machine. Stop it with Ctrl + C.

bash β€” 80Γ—24
student@devops:~$ping 8.8.8.8

Then test a domain name β€” if this works, DNS is resolving correctly:

bash
ping google.com

Routing and Open Ports

bash
ip route     # where does traffic go? shows the default gateway
ss -tuln     # which ports are listening on this machine?
bash β€” 80Γ—24
student@devops:~$ip route

The routing table tells Linux where to send network traffic; ss -tuln is invaluable for checking whether your application is actually listening.


Downloading from the Network

bash
curl https://example.com     # fetch a URL and print it
wget https://example.com     # download a file

These commands appear constantly in automation scripts.


Real DevOps Example

A deployment fails because the server can’t reach GitHub. The very first check:

bash β€” 80Γ—24
student@devops:~$ping github.com

That error points straight at DNS β€” if networking is broken, nothing else matters.


πŸ§ͺ Hands-on Lab

πŸ“

Diagnose Your Network

Run each command and note the output:

  1. hostname and hostname -I
  2. ip addr β€” find your active interface
  3. ip route β€” find your default gateway
  4. ping 8.8.8.8 then ping google.com (Ctrl + C to stop)

Write down your hostname, IP, gateway, and active interface.

πŸ’‘ DevOps Tip

Whenever something β€œdoesn’t work,” first ask: is it a network problem? A huge share of production incidents begin with connectivity or DNS.


⚠ Common Beginner Mistakes

⚠ Ping the IP, then the name

If ping 8.8.8.8 works but ping google.com fails, your connectivity is fine but DNS is misconfigured. Testing an IP and a domain separately instantly narrows down the problem.


🧠 Knowledge Check

Knowledge Check

Which command displays your machine's IP address?

Knowledge Check

ping 8.8.8.8 succeeds but ping google.com fails. What's the likely problem?


πŸ’Ό Interview Preparation

Interview Q&A

Walk me through how you'd troubleshoot 'the server can't reach the internet'.


Summary

You now understand the networking fundamentals used by Linux servers everywhere β€” interfaces, IPs, routing, connectivity, and DNS.

Up Next

SSH β€” Secure Shell

You've mastered this lesson. Continue your journey to becoming a DevOps Engineer.

Start Next Lesson→