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

Custom netplan changes revert after reboot, causing unstable network behavior.

Environment & Reproduction

Common on cloud images where cloud-init manages network configuration.

cloud-init status --long
ls -l /etc/netplan
sudo reboot

Root Cause Analysis

cloud-init datasource re-renders netplan files at boot and overrides manual edits.

Quick Triage

Confirm cloud-init ownership of networking and inspect generated files.

grep -R network: /etc/cloud/cloud.cfg /etc/cloud/cloud.cfg.d -n
ls -l /etc/netplan
cloud-init query --all | head -n 40

Step-by-Step Diagnosis

Track cloud-init boot stages and file write events.

sudo journalctl -u cloud-init -n 120
sudo cat /run/cloud-init/network-config.json
sudo cloud-init analyze blame
Illustrative mockup for ubuntu-26-04-lts β€” terminal_or_shell
cloud-init state and netplan checks β€” Illustrative mockup β€” Progressive Robot

Solution – Primary Fix

Disable cloud-init network config and manage netplan directly.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

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
sudo netplan generate
sudo netplan apply
Illustrative mockup for ubuntu-26-04-lts β€” logs_or_journal
cloud-init logs for networking stages β€” Illustrative mockup β€” Progressive Robot

Solution – Alternative Approaches

Keep cloud-init in control and update its user-data network section instead.

sudoedit /var/lib/cloud/seed/nocloud-net/user-data
sudo cloud-init clean --logs
sudo reboot

Verification & Acceptance Criteria

Network config remains stable across reboot cycles.

sudo reboot
ls -l /etc/netplan
ip -br a

Rollback Plan

Remove disable file and restore cloud-init generated netplan if needed.

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

Prevention & Hardening

Define ownership model for network configuration per image type and environment.

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

Related to DHCP lease churn, route metric conflicts, and metadata service changes.

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 networking docs and netplan integration 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.