π ~1 min read
Table of contents
Symptom & Impact
Manual network settings are replaced on reboot, causing connectivity drift and outages.
Environment & Reproduction
Common on cloud images cloned into non-cloud environments.
sudo reboot
cat /etc/netplan/*.yaml
Root Cause Analysis
cloud-init network stage remains active and regenerates netplan from datasource metadata.
Quick Triage
Check cloud-init datasource, generated config files, and service history.
cloud-init status --long
ls -l /etc/cloud/cloud.cfg.d
journalctl -u cloud-init -n 80 --no-pager
Step-by-Step Diagnosis
Determine whether cloud-init owns networking and which datasource is active.
cloud-id
grep -R 'network:' /etc/cloud/cloud.cfg /etc/cloud/cloud.cfg.d -n
ls -l /etc/netplan

Solution – Primary Fix
Disable cloud-init network configuration and apply managed netplan settings.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg >/dev/null <<'EOF'
network: {config: disabled}
EOF
sudo netplan generate
sudo netplan apply
sudo reboot

Solution – Alternative Approaches
Keep cloud-init enabled but supply explicit network-config for deterministic behavior.
sudo cloud-init clean --logs
sudo cloud-init init --local
Verification & Acceptance Criteria
Network settings persist across reboots and cloud-init no longer rewrites netplan.
sudo reboot
ls -l /etc/netplan
cloud-init status
Rollback Plan
Remove disable file and rerun cloud-init stages if cloud automation is required.
sudo rm -f /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
sudo cloud-init clean --logs
sudo reboot
Prevention & Hardening
Define image role (cloud vs on-prem) and pin cloud-init policy accordingly.
dpkg -l | grep cloud-init
cloud-init query ds
Related Errors & Cross-Refs
Related to hostname reset and SSH key regeneration surprises on first boot.
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 documentation and Ubuntu image customization guidance.
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.