Switch network configuration from ifupdown to netplan
Switch network configuration from ifupdown to netplan
In cloud servers created from ready-made images with Ubuntu 18.04, 20.04, and 22.04 operating systems, the ifupdown utility is used by default to configure the network.
You can switch network configuration from ifupdown to netplan — the procedure depends on whether the cloud-init agent is installed in the image.
Cloud-init is installed
Cloud-init is not installed
-
Remove ifupdown:
sudo apt purge ifupdown
-
Perform a programmatic reboot of the server:
sudo reboot now
The cloud-init agent will independently configure the network for netplan.
-
Create a configuration file for netplan:
nano /etc/neplan/config.yaml
-
Optional: enter the necessary network settings in the file. Examples can be found in the instructions Modify the cloud server network configuration file.
-
Check the syntax of the file:
sudo netplan try
-
Apply the settings:
sudo netplan apply