Linux Labs

Networking / Stage 3 of 14

Persistent networking with Netplan

Not running Starting usually ~20 s
Leave the lesson

Step 7 of 9 · lab · 25 mineasy

Netplan: restore the link to the neighbour

The training interface lab0 is up, yet the neighbour 192.0.2.1 does not answer. Find the cause and fix the persistent network configuration without touching anything else.

Situation

This machine has a training interface, lab0. A veth pair connects it to the neighbour 192.0.2.1, which lives in the lab-peer network namespace. The interface is up, but the neighbour does not answer ping.

According to the address plan, lab0 has 192.0.2.10/24, and the address must come from the persistent Netplan configuration: lab0 is described in /etc/netplan/50-lab.yaml. lab0 is an interface of the machine itself: it needs no -n or ip netns exec.

Task

  1. In /etc/netplan/50-lab.yaml and in Netplan's merged configuration, lab0 has the single address 192.0.2.10/24, dhcp4: false and renderer: networkd; the file keeps its owner and mode, root:root and 600.
  2. The up lab0 now has exactly one IPv4 address, 192.0.2.10/24.
  3. The path to 192.0.2.1 goes directly through lab0 with the source address 192.0.2.10.
  4. The neighbour 192.0.2.1 answers ping and keeps its address.
  5. The rest of the machine's network, other network settings files and the lab0–peer0 pair are untouched, and there are no workaround services or scripts.

Constraints

  • A fix with a single ip command does not solve the task: after netplan apply or a reboot the address comes from the configuration again.
  • Don't recreate the neighbour or the interface pair, and don't set a global renderer.

The tools you need are already installed. There's no internet on this machine.

Lab · on your own

No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.

Goals

0 of 5
  • Netplan gives lab0 only 192.0.2.10/24, dhcp4 false, renderer networkd — not done yet
  • The up lab0 now has exactly one IPv4 address — 192.0.2.10/24 — not done yet
  • The path to 192.0.2.1 goes directly through lab0 with source 192.0.2.10 — not done yet
  • Neighbour 192.0.2.1 answers ping and keeps its address — not done yet
  • The rest of the network, its settings and the training interface pair are untouched — not done yet
Ctrl+Enter
Starts the machine node1 · Ubuntu 24.04

The machine is starting

Hints

0 of 3

Lab goals

0 of 5
  • Netplan gives lab0 only 192.0.2.10/24, dhcp4 false, renderer networkd — not done yet
  • The up lab0 now has exactly one IPv4 address — 192.0.2.10/24 — not done yet
  • The path to 192.0.2.1 goes directly through lab0 with source 192.0.2.10 — not done yet
  • Neighbour 192.0.2.1 answers ping and keeps its address — not done yet
  • The rest of the network, its settings and the training interface pair are untouched — not done yet
node1 Ubuntu 24.04

Lab goals

0 of 5
  • Netplan gives lab0 only 192.0.2.10/24, dhcp4 false, renderer networkd — not done yet
  • The up lab0 now has exactly one IPv4 address — 192.0.2.10/24 — not done yet
  • The path to 192.0.2.1 goes directly through lab0 with source 192.0.2.10 — not done yet
  • Neighbour 192.0.2.1 answers ping and keeps its address — not done yet
  • The rest of the network, its settings and the training interface pair are untouched — not done yet
Loading…