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 changes disappear after reboot, causing interface drift and connectivity loss.

Environment & Reproduction

Common on cloud images where cloud-init continues to manage networking.

cloud-init status
ls /etc/cloud/cloud.cfg.d
ls /etc/netplan

Root Cause Analysis

Datasource-provided network config regenerates netplan files, replacing manual edits.

Quick Triage

Confirm which component last modified netplan files.

sudo ls -ltr /etc/netplan
sudo grep -RIn 'network:' /etc/cloud/cloud.cfg.d /etc/cloud/cloud.cfg 2>/dev/null
journalctl -u cloud-init -n 120 --no-pager

Step-by-Step Diagnosis

Trace cloud-init stages and datasource metadata influencing network output.

cloud-init analyze show 2>/dev/null || true
cloud-init query ds 2>/dev/null || true
cat /run/cloud-init/network-config.json 2>/dev/null || true
Illustrative mockup for ubuntu-26-04-lts β€” terminal_or_shell
Inspecting cloud-init network datasource behavior β€” Illustrative mockup β€” Progressive Robot

Solution – Primary Fix

Disable cloud-init network management and persist custom netplan configuration.

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
Illustrative mockup for ubuntu-26-04-lts β€” log_or_config
Disabling cloud-init network config rewrite β€” Illustrative mockup β€” Progressive Robot

Solution – Alternative Approaches

Keep cloud-init enabled but supply stable network-data in metadata for immutable provisioning.

sudo cloud-init clean
sudo cloud-init init

Verification & Acceptance Criteria

Netplan files remain unchanged across reboot and interfaces keep expected settings.

sudo sha256sum /etc/netplan/*.yaml
sudo reboot
sudo sha256sum /etc/netplan/*.yaml

Rollback Plan

Remove disable file if platform requires datasource-managed networking.

sudo rm -f /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
sudo cloud-init clean
sudo reboot

Prevention & Hardening

Decide ownership model for networking during image build and enforce it consistently.

cloud-init status
grep -RIn 'config: disabled' /etc/cloud/cloud.cfg.d

Tied to DHCP lease churn, wrong interface names, and boot-time renderer conflicts.

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 cloud-init network configuration references and operational best practices.

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.