Skip to content

Linux Foundations / Follow traffic and find the fault ยท Step 1 of 46

Lesson: Network BasicsSwitch
โ† Linux Foundations

Network operations

Network Basics

The core ideas of networking: hosts, links, packets, switches, routers and how to check your own connection.

A network is two or more devices that can exchange data. Linux runs a large share of the world's servers and network devices, so these ideas are worth learning early.

Hosts, links and networks

Any device with a network address that sends or receives data is a host. Hosts connect through links, such as Ethernet cables or Wi-Fi radio.

A LAN (local area network) covers a small area such as a home or office. A WAN (wide area network) spans long distances. The internet is a worldwide network of many interconnected networks.

Switches and routers

A switch connects devices within one local network. A router connects different networks and passes traffic between them. The box in a typical home does both, and also acts as a Wi-Fi access point.

Your default gateway is the router your computer uses for destinations outside its own network.

Packets and protocols

Data is split into small pieces called packets. Each carries addressing information as well as part of the data. Packets can take different routes, and they can be lost.

A protocol is an agreed set of rules for communication. IP handles addressing and delivery between networks. TCP adds reliable, ordered delivery. HTTP is what web browsers and servers speak.

Often one side is a client, which asks, and the other a server, which answers.

Looking at your own system

The ip command shows your configuration:

$ ip -br address
lo      UNKNOWN  127.0.0.1/8 ::1/128
enp1s0  UP       192.168.1.20/24

$ ip route
default via 192.168.1.1 dev enp1s0
192.168.1.0/24 dev enp1s0 proto kernel scope link src 192.168.1.20

lo is the loopback interface, which a machine uses to talk to itself. Interface names differ between systems. Older guides use ifconfig and route, which many distributions no longer install by default.

To test reachability, use ping:

$ ping -c 3 192.168.1.1

On Linux, -c 3 stops after three requests. Some hosts and firewalls ignore ping, so silence does not always mean a host is down.

Try it

Run ip -br address and ip route. Find your address and your gateway, then ping the gateway. For a broader tour, read the networking basics guide or open the networking and SSH lab.

Check your understanding

Network Basics

All 4 sections ยท no timer

Unlimited retries

Questions from every section are combined into one assessment. Answer them all correctly to complete the article.

Your completion saves in this browser. Sign in to sync it to your account.