Linux FundamentalsOptional

Networking on Linux

Inspect interfaces, sockets, and connectivity from the command line.

40 min read intermediate 3 objectives

Status

Not started

What you will learn

  • Read interface and route config
  • Diagnose open ports
  • Test connectivity

New to this? Start here

The basics, in plain English

Networking is how one computer talks to another. From the command line you can check your machine’s address, see which doors (ports) are open, and test whether you can reach another computer.

Network
Two or more computers connected so they can send data to each other.
IP address
A computer’s numeric address on the network, like a house address for data.
Port
A numbered doorway on a computer. Different services listen on different ports (web is usually 80 or 443).
Interface
The hardware or software connection point your machine uses to reach the network (like Wi-Fi or ethernet).
curl
A command that fetches a web address from the terminal, to test if a server responds.
DNS
The phonebook of the internet: it turns a name like google.com into an IP address.
01

The tools

ip replaces ifconfig for addresses and routes. ss shows sockets. curl and dig test HTTP and DNS.

02

Debugging

When something cannot connect, walk the stack: is the interface up, is there a route, is the port listening, is DNS resolving.

Try it yourself

bash
$ip addr show
List network interfaces and their IP addresses.
$ss -tulpn
Show which ports are open and which process owns each one.
$dig +short example.com
Resolve a domain to its IP, output kept brief.
$curl -I https://example.com
Fetch just the response headers to check status and server.
↳ lines explain what each command does — only the commands get copied

Finished this topic?

Mark it done to earn 100 XP and keep your streak alive.