Skip to content

Lesson 09 — Linux Networking

Almost every Linux server communicates with other systems over a network.

Whether you’re:

  • Accessing a website
  • Connecting to an AWS EC2 instance using SSH
  • Deploying Kubernetes clusters
  • Downloading software updates
  • Accessing cloud storage
  • Connecting to a database

Linux networking makes it all possible.

As a Cloud Engineer, DevOps Engineer, Linux Administrator, or Cybersecurity Professional, you’ll spend a significant amount of your time troubleshooting network connectivity, configuring interfaces, verifying DNS resolution, and monitoring traffic.

In this lesson, you’ll learn the Linux networking fundamentals that are used daily in enterprise environments.


After completing this lesson, you will be able to:

  • Understand Linux network interfaces.
  • View and configure IP addresses.
  • Understand routing and gateways.
  • Configure DNS.
  • Test network connectivity.
  • Troubleshoot networking issues.
  • Use common Linux networking commands.

Every Linux server connects to a network using one or more Network Interfaces.

A network interface allows Linux to send and receive data.

Example:

Linux Server
Network Interface
Switch
Router
Internet

Without a network interface, a server cannot communicate with other devices.


Modern Linux systems use predictable interface names.

Common examples:

eth0
ens33
ens160
enp0s3
wlan0

Cloud platforms often use names such as:

ens5
eth0

Display all interfaces.

Terminal window
ip link show

or

Terminal window
ip link

Example output:

lo
ens33

Display IP configuration.

Terminal window
ip addr

or

Terminal window
ip a

Example:

ens33
192.168.1.100/24

This command replaces the older ifconfig utility.


Example:

192.168.1.100/24

Where:

  • 192.168.1.100 = IP Address
  • /24 = Subnet Prefix

This identifies the host on the local network.


Linux always includes the Loopback Interface.

lo

Loopback IP:

127.0.0.1

Purpose:

  • Local communication
  • Application testing
  • Service verification

Display routing table.

Terminal window
ip route

Example:

default via 192.168.1.1

The default gateway sends traffic destined for external networks.


The default gateway forwards traffic outside the local network.

Example:

Linux Server
Gateway
192.168.1.1
Internet

Without a default gateway, Internet connectivity is not possible.


Linux stores DNS configuration in:

/etc/resolv.conf

Example:

nameserver 8.8.8.8

Display DNS settings.

Terminal window
cat /etc/resolv.conf

Display hostname.

Terminal window
hostname

Display detailed hostname information.

Terminal window
hostnamectl

Change hostname.

Terminal window
sudo hostnamectl set-hostname web-server

Ping another device.

Terminal window
ping google.com

Ping an IP address.

Terminal window
ping 8.8.8.8

Successful replies indicate network connectivity.


View the path packets take.

Ubuntu:

Terminal window
traceroute google.com

If not installed:

Terminal window
sudo apt install traceroute

This command helps identify routing issues.


Use nslookup.

Terminal window
nslookup gohackerscloud.com

Or:

Terminal window
dig gohackerscloud.com

Install if required.

Terminal window
sudo apt install dnsutils

These tools verify DNS functionality.


Display listening services.

Terminal window
ss -tuln

Example output:

22
SSH
80
HTTP
443
HTTPS

The ss command replaces the older netstat utility.


Some enterprise systems still use:

Terminal window
netstat -tuln

Install if required.

Terminal window
sudo apt install net-tools

Retrieve a webpage.

Terminal window
curl https://www.gohackerscloud.com

View only headers.

Terminal window
curl -I https://www.gohackerscloud.com

curl is widely used for testing APIs and web services.


Use wget.

Terminal window
wget https://example.com/file.txt

This downloads files directly from the command line.


Display active network connections.

Terminal window
ss -tunap

This command helps identify active clients and services.


Display interface statistics.

Terminal window
ip -s link

Useful information includes:

  • Packets Sent
  • Packets Received
  • Errors
  • Dropped Packets

Ubuntu (NetworkManager):

Terminal window
sudo systemctl restart NetworkManager

Ubuntu Server (systemd-networkd):

Terminal window
sudo systemctl restart systemd-networkd

Restart networking after configuration changes if required.


Cloud Engineers regularly configure networking on Linux virtual machines.

Examples:

AWS EC2

  • Private IP
  • Elastic IP
  • Security Groups
  • Route Tables

Azure Virtual Machine

  • Virtual Network
  • Network Security Groups

Google Compute Engine

  • VPC Network
  • Firewall Rules

Linux networking knowledge is essential for cloud administration.


Every Kubernetes node relies on Linux networking.

Examples include:

  • Pod Communication
  • Cluster Networking
  • CNI Plugins
  • DNS Resolution
  • Service Discovery

Networking issues are among the most common Kubernetes troubleshooting scenarios.


Security professionals investigate:

  • Open ports
  • Unauthorized connections
  • DNS anomalies
  • Packet loss
  • Suspicious outbound traffic
  • Remote access sessions

Many security investigations begin with Linux networking commands.


Display interfaces:

Terminal window
ip link

Display IP addresses:

Terminal window
ip addr

Display routing table:

Terminal window
ip route

Display hostname:

Terminal window
hostnamectl

Ping host:

Terminal window
ping google.com

DNS lookup:

Terminal window
dig gohackerscloud.com

Display listening ports:

Terminal window
ss -tuln

Download webpage:

Terminal window
curl https://www.gohackerscloud.com

Download file:

Terminal window
wget URL

A Cloud Engineer deploys an application to an Ubuntu server.

After deployment, users cannot access the website.

The engineer investigates using the following workflow:

Check IP Address
ip addr
Verify Default Gateway
ip route
Test DNS
dig gohackerscloud.com
Check Web Server
systemctl status nginx
Verify Port 443
ss -tuln
Website Restored

This structured troubleshooting process is commonly used in enterprise environments.


As a Linux administrator:

  • Use ip instead of deprecated networking tools where possible.
  • Assign meaningful hostnames.
  • Verify DNS configuration after deployment.
  • Monitor open ports regularly.
  • Remove unused network services.
  • Document IP addressing schemes.
  • Restrict unnecessary inbound ports using firewalls.
  • Test connectivity after every network change.

Good networking practices improve reliability, security, and maintainability.


After completing this lesson, you should understand:

  • Linux network interfaces.
  • IP address configuration.
  • Routing and default gateways.
  • DNS configuration.
  • Network troubleshooting commands.
  • Open ports and active connections.
  • Linux networking in cloud and enterprise environments.

Linux Networking is a core skill for every IT professional.

Whether you’re deploying cloud infrastructure, managing enterprise servers, troubleshooting applications, or investigating cybersecurity incidents, you’ll rely on Linux networking commands every day.

By mastering interfaces, IP addressing, DNS, routing, and troubleshooting tools, you’ll be well prepared to administer Linux systems in AWS, Azure, Google Cloud, Kubernetes, and enterprise data centers.


➡️ Lesson 10 — Linux Storage & Disk Management

In the next lesson, you’ll learn how Linux manages disks, partitions, file systems, mounting, storage devices, and logical volume management (LVM), and discover how enterprise Linux servers handle persistent storage.