πŸ“– ~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 netplan changes disappear after reboot and network returns to undesired DHCP settings. Static routes and DNS overrides fail, breaking production traffic policies.

Environment & Reproduction

Ubuntu 22.04 LTS cloud image with cloud-init enabled. Reproduce by editing /etc/netplan YAML directly and rebooting without disabling cloud-init network rendering.

Root Cause Analysis

cloud-init owns initial networking on many cloud images and regenerates netplan files from datasource metadata. Manual file edits are overwritten during boot stages.

Quick Triage

Identify whether netplan file is cloud-generated and inspect cloud-init status before applying persistent manual network changes.

Step-by-Step Diagnosis

Review cloud-init logs and network config sources to confirm overwrite mechanism and determine whether datasource metadata is reapplying unwanted values.

Illustrative mockup for ubuntu-22-04-lts β€” cloudinit_net_overwrite
Cloud-init regenerates netplan and removes manual static settings β€” Illustrative mockup β€” Progressive Robot

Solution – Primary Fix

Disable cloud-init network management, create admin-owned netplan file, and apply configuration. Preserve cloud-init for other modules if required.

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

Illustrative mockup for ubuntu-22-04-lts β€” cloudinit_disable_network_fix
Cloud-init network config disabled to preserve admin-managed netplan β€” Illustrative mockup β€” Progressive Robot

Solution – Alternative Approaches

Manage networking through cloud-init datasource metadata instead of disabling module, or bake desired static netplan into custom image templates.

Verification & Acceptance Criteria

Reboot retains intended netplan settings, interface addresses remain stable, and cloud-init no longer rewrites network files unexpectedly.

Rollback Plan

Remove disable config, restore original cloud-init netplan file from backup, and reboot to return datasource-managed networking behavior.

Prevention & Hardening

Define ownership model for networking early, document whether cloud-init or admin controls netplan, and enforce with image baseline policies.

Often connected to DHCP route changes after reboot, DNS drift from metadata servers, and accidental dual definitions in multiple netplan files.

Related tutorial: View the step-by-step tutorial for Ubuntu 22.04 LTS.

View all Ubuntu 22.04 LTS tutorials on the Tutorials Hub β†’

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

See cloud-init networking docs, Ubuntu cloud image guidance, and netplan documentation for persistent configuration strategy.

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.