Fixes

Fix

IP address and routes are gone after a reboot

Settings made with ip addr and ip route live only in the running kernel. Write them to the system's network configuration so they are applied at boot.

Likely causes

  1. The address and routes were set with ip commands only, never written to a file.
  2. They were written, but to a file this system does not read (ifupdown, netplan and NetworkManager each have their own), or with a mistake in it.

Diagnose

Run these in order. The output is what each printed on a lab's real Linux machines.

leo:~# ip -br -4 addr
After the restart only lo has an address: the card's is gone, and its routes went with it.
lo               UNKNOWN        127.0.0.1/8 

Fix

/etc/network/interfaces on leo
On Alpine and Debian (ifupdown), the card's address, mask and gateway go in /etc/network/interfaces.
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
    address 10.0.1.10
    netmask 255.255.255.0
    gateway 10.0.1.2
leo:~# ifup -v eth0
ifup reads the file and runs the same ip commands, as the machine does at every start.
run-parts /etc/network/if-pre-up.d
ip addr add 10.0.1.10/24 dev eth0 label eth0
ip link set eth0 up
ip route add default via 10.0.1.2 dev eth0
run-parts /etc/network/if-up.d
leo:~# curl -sS -m 5 http://zoe.lab/
And the page loads by name.
Zoe's studio is open until six

Break it and fix it yourself

Each lab is a small network of real Linux machines in your browser, where this fault happens.

Open Linux networking: bring a blank machine online by hand

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab