Affected versions: Ubuntu 26.04 LTS Ubuntu 26.04 Ubuntu 26.04.1

πŸ“– ~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

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
Illustrative mockup for ubuntu-26-04-lts β€” terminal_or_console
Diagnosis commands for post 156 β€” Illustrative mockup β€” Progressive Robot

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
Illustrative mockup for ubuntu-26-04-lts β€” log_or_dashboard
Fix validation evidence for post 156 β€” Illustrative mockup β€” Progressive Robot

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