📖 ~1 min read
Table of contents
Symptom & Impact
Applying netplan fails or disconnects interfaces, leading to remote access loss and service interruption.
Environment & Reproduction
Usually follows manual YAML edits, template merges, or cloud-init overwrites.
ip -br a
ls /etc/netplan
sudo netplan generate
sudo netplan apply
Root Cause Analysis
YAML indentation, renderer mismatch, or invalid interface names cause netplan generation failures.
Quick Triage
Use try mode and inspect parser output before committing changes.
sudo netplan --debug generate
sudo netplan try
networkctl status
Step-by-Step Diagnosis
Validate schema and verify current renderer ownership of interfaces.
sudo python3 - <<'PY'
import yaml,glob
[ yaml.safe_load(open(f)) for f in glob.glob('/etc/netplan/*.yaml') ]
print('ok')
PY
systemctl status systemd-networkd NetworkManager

Solution – Primary Fix
Restore a known-good netplan file and apply with safe sequencing.
Still having issues? Our Network Design team can diagnose and resolve this for you. Get in touch for a free consultation.
sudo cp /etc/netplan/01-netcfg.yaml /etc/netplan/01-netcfg.yaml.bak.$(date +%s)
sudo tee /etc/netplan/01-netcfg.yaml >/dev/null <<'EOF'
network:
version: 2
renderer: networkd
ethernets:
enp1s0:
dhcp4: true
EOF
sudo netplan generate
sudo netplan apply

Solution – Alternative Approaches
Use NetworkManager renderer for desktop-style profiles when required.
sudo sed -i 's/renderer: networkd/renderer: NetworkManager/' /etc/netplan/*.yaml
sudo netplan generate
sudo netplan apply
Verification & Acceptance Criteria
Interfaces obtain expected addresses and route connectivity is stable.
ip -br a
ip route
resolvectl status
ping -c 3 1.1.1.1
Rollback Plan
Revert to backup YAML and reapply if connectivity degrades.
sudo cp /etc/netplan/01-netcfg.yaml.bak.* /etc/netplan/01-netcfg.yaml
sudo netplan generate
sudo netplan apply
Prevention & Hardening
Use version-controlled netplan templates and run generate checks before apply.
sudo netplan generate
sudo netplan try
grep -RIn 'renderer' /etc/netplan
Related Errors & Cross-Refs
Related to DNS resolver failures, interface rename changes, and cloud-init network rewrites.
Related tutorial: View the step-by-step tutorial for Ubuntu 26.04 LTS.
View all Ubuntu 26.04 LTS tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Ubuntu netplan and systemd-networkd documentation for persistent network configuration.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.