π ~1 min read
Table of contents
Symptom & Impact
Administrators observe: Ubuntu 26.04 LTS – cloud-init overwrites custom netplan configuration on reboot. Networking changes do not persist.
Environment & Reproduction
Issue appears on cloud instances where cloud-init networking remains enabled.
# Baseline context
lsb_release -a
cloud-init status --long || true
ls /etc/cloud/cloud.cfg.d
ls /etc/netplan
sudo journalctl -u cloud-init -n 80 --no-pager
Root Cause Analysis
cloud-init regenerates netplan at boot from datasource metadata, replacing manual edits unless disabled or overridden.
Quick Triage
Confirm whether cloud-init wrote the active netplan files.
# Quick triage
grep -R 'generated by cloud-init' /etc/netplan || true
sudo cloud-init query --all | head -n 60 || true
stat /etc/netplan/*.yaml
Step-by-Step Diagnosis
Trace boot sequence and cloud-init modules affecting networking.
# Detailed diagnosis
sudo journalctl -b -u cloud-init -u cloud-config -u cloud-final --no-pager | tail -n 200
cloud-init analyze show || true
cloud-init analyze blame || true

Solution – Primary Fix
Disable cloud-init network rendering and persist netplan locally.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
# Primary fix
echo 'network: {config: disabled}' | sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
sudo rm -f /etc/netplan/50-cloud-init.yaml
sudoedit /etc/netplan/01-netcfg.yaml
sudo netplan generate
sudo netplan apply

Solution – Alternative Approaches
Keep cloud-init enabled but provide datasource-level network config that matches desired state.
# Alternative
sudoedit /etc/cloud/cloud.cfg.d/90_dpkg.cfg
# Add datasource-specific network config
sudo cloud-init clean
sudo reboot
Verification & Acceptance Criteria
Netplan files and routes remain unchanged after reboot.
# Verify
sudo reboot
# After reboot
ls /etc/netplan
grep -R 'generated by cloud-init' /etc/netplan || true
ip r
Rollback Plan
Remove disable override and restore cloud-init generated netplan if provider management is required.
# Rollback
sudo rm -f /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
sudo cloud-init clean
sudo reboot
Prevention & Hardening
Document whether networking authority is cloud-init or local netplan to prevent config drift.
# Hardening
cloud-init status --long || true
sudo cloud-init schema --system || true
Related Errors & Cross-Refs
Related issues include DHCP fallback after reboot and stale cloud metadata causing incorrect static routes.
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
cloud-init networking reference and Ubuntu cloud image customization documentation.
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.