Netplan changes do nothing, or take the network down
Netplan is a front end. The configuration is only real once it has been rendered to the back end that is actually running.
What you see
An edited YAML file has no effect after netplan apply, or the machine drops off the network entirely and has to be recovered at the console.
What is actually wrong
Two configuration files where the later one wins, cloud-init rewriting the file at boot, or a renderer mismatch — the YAML naming networkd while NetworkManager is the thing actually managing the interface.
Codes and articles
Fixes (3)
Find which file is actually winning
The apply succeeds and nothing changes.
List every file netplan will read. They are processed in lexical order and later files override earlier ones.
ls -l /etc/netplan/A hand-written 01-static.yaml is overridden by the 50-cloud-init.yaml that ships on most cloud and Ubuntu Server images. Editing the wrong one is the single most common cause of this.
See what netplan produces from all of them together.
netplan getsudo netplan generate --debug 2>&1 | tail -30
Check which renderer is in use and which is actually running.
grep -r renderer /etc/netplan/systemctl is-active systemd-networkd NetworkManager
Consolidate into a single file with correct permissions — netplan warns about world-readable files that contain Wi-Fi keys.
sudo chmod 600 /etc/netplan/*.yamlApply and confirm.
sudo netplan applyip -brief addr showip route show
ip -brief addr; ip route; resolvectl status | head -20Apply safely, and recover when it goes wrong
The change took the network down — or before making one on a remote machine.
Use netplan try rather than netplan apply on any remote machine. It reverts automatically after 120 seconds unless confirmed.
sudo netplan try --timeout 120This is the difference between a mistake that costs two minutes and one that costs a trip to the site. It exists for exactly this and almost nobody uses it.
If you are already locked out, get to the console — the hypervisor console, IPMI, or physical.
Restore the backup and apply.
sudo cp -a /root/netplan-backup/* /etc/netplan/sudo netplan apply
With no backup, bring the interface up by hand to restore access while you fix the file.
sudo ip addr add 192.168.1.50/24 dev ens18sudo ip link set ens18 upsudo ip route add default via 192.168.1.1
Check the YAML for the usual errors: tabs instead of spaces, a missing colon, or an interface name that does not exist.
sudo netplan generate 2>&1ip -brief link show
sudo netplan apply && ip -brief addrStop cloud-init rewriting the network configuration
The configuration reverts on every reboot.
Confirm cloud-init is responsible.
head -5 /etc/netplan/50-cloud-init.yamlcloud-init status --long
Disable its network module rather than removing cloud-init, which does other useful things.
echo 'network: {config: disabled}' | sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfgDeleting 50-cloud-init.yaml alone does not work — cloud-init simply writes it again at the next boot. This file is the supported way to tell it not to.
Write the real configuration in a file of your own.
sudoedit /etc/netplan/60-static.yamlApply and reboot to confirm it persists.
sudo netplan applysudo reboot
ip -brief addr; ls -l /etc/netplan/Related faults
Where this stops. This write-up was written and checked by hand. It says what each step changes, how to confirm it worked and how to reverse it, and anything destructive is flagged before you reach it. If it does not match what your machine is doing, search the Support Centre for the exact code or message — and when something needs a person, get in touch.