Affected versions: Ubuntu 26.04 LTS

πŸ“– ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

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
Illustrative mockup for ubuntu-26-04-lts β€” cloudinit_network_overwrite
cloud-init network overwrite evidence β€” Illustrative mockup β€” Progressive Robot

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
Illustrative mockup for ubuntu-26-04-lts β€” cloudinit_network_disabled
cloud-init network stage disabled and netplan preserved β€” Illustrative mockup β€” Progressive Robot

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 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.