Chapter 17. Network Configuration and Troubleshooting
Every network task in this chapter reduces to one model: a link carries
addresses, addresses sit inside prefixes, routes send packets toward
prefixes, and name resolution picks the addresses that applications
actually use. Once that model is in place, configuring a wired interface,
joining a wireless network, running IPv4 and IPv6 at the same time, and
finding the layer where a connection fails all become variations of the
same few inspections. The inspections themselves are small - ip, ping,
resolvectl, ss, tcpdump - and this chapter exercises each one
against a working two-machine lab rather than listing options in the
abstract.
Debian 13 can configure those links with three different backends: NetworkManager, ifupdown, and systemd-networkd. They can be installed at the same time, which is the source of most "my network is broken after a change" incidents on machines that mix them. The chapter therefore treats the backends as a first-class subject: how to recognize which one is active, how to keep exactly one owner per interface, and how to hand an interface from one backend to another without losing the session that is doing the work.
The walkthrough uses two Debian 13 machines connected by an isolated practice LAN:
| Host | Role | Network interfaces |
|---|---|---|
netlab1 |
Debian system being configured and diagnosed | eth0 - primary interface, 192.168.121.24/24, default route via 192.168.121.1; eth1 - practice link on 192.168.217.0/24; wlan0 - practice wireless client added in Section 17.4 |
router1 |
gateway for the practice LAN | eth1 - 192.168.217.2 and 2001:db8:17:1::2; answers DHCP, DNS for lab.example, and IPv6 router advertisements; its own access path stays on the separate primary network, so work on its eth1 never blocks SSH |
The practice LAN uses reserved ranges - RFC 1918 private space
(192.168.0.0/16) plus the documentation blocks 2001:db8::/32 and
198.51.100.0/24 - so nothing here can disturb a real network. router1
runs the services a real site would run - dnsmasq for DHCP and DNS,
radvd for IPv6 router advertisements - and building production DNS, DHCP,
and router-advertisement services is Chapter 22's
subject. Both machines have the john account with sudo access, as set
up during installation
(Chapter 2) and described in
Chapter 5.
Commands entered in john's ordinary shell begin with $ and commands
entered in a root shell begin with #; the prompt marker is not typed.
Where a single elevated command is more natural than a root shell, it is
written $ sudo command. sudo asks for john's password the first time
in a session; the password is not echoed. A root shell - entered with
$ sudo -i and left with exit - is used for the sustained
configuration sequences, and each section says which shell it assumes.
Except where a block names another host, every command runs on netlab1.
Editing files is done with the terminal editor covered in
Chapter 3.
Create the reader workspace before the first example. Captures, practice
files, and the packet capture written later stay under it; system
configuration stays in /etc, /run, and the other paths the system
expects:
$ mkdir -p ~/debian-handbook/network-basics
The command prints nothing when it succeeds. Make it the working
directory with cd ~/debian-handbook/network-basics; the relative paths
used later in the chapter - recovered in Section 17.2.4, index.html
in Section 17.7.3 - are written from inside it. Shell basics, pipelines,
and redirection come from Chapter 3; systemd
services,
transient units, and the journal from Chapter 8;
timers from Chapter 10; and the desktop's
network controls from Section 4.5.4 in Chapter
4. Chapter 18 covers firewalls, Chapter
19 bridges, bonds, and policy routing, and
Chapter 20 remote administration with SSH.