A successful command does not yet mean the network is configured. The result is checked in three places.
| Check | What it catches |
|---|---|
the merged configuration: sudo netplan get |
an extra file, a wrong address |
the address on the interface: ip -brief -4 address show dev lab0 |
the configuration was not applied |
the exchange with the neighbour: ping -c 2 -W 1 192.0.2.1 |
the path or the neighbour |
A correct file with the old address on the interface means apply was not run. A correct address with a wrong file lasts until the next apply or reboot, as you saw in the first exercise. Both are correct and the neighbour is silent: look for the cause in the routes and on the neighbour's side, not in the file.
After an edit, sudo netplan generate ran without errors. What does that prove?
-
generatedoes not touch interfaces: in the exercise the address changed only afterapply.ip -brief -4 address show dev lab0shows the current one. -
generatechecks the notation, not the intent: to it,192.0.3.10/24is just as valid an address.sudo netplan getshows what is written. -
generatedoes not check the exchange with the neighbour;ping -c 2 -W 1 192.0.2.1does.
generate checks that the files are written correctly and prepares the configuration for networkd. The address on the interface and the exchange with the neighbour are checked with ip and ping.
Key points
-
A network configuration is checked three times: the result in
netplan get, the address inipand the exchange inping. -
A correct address with a wrong file disappears at the next
apply.