ubuntu 18.04 network after cloud-init removal
I installed new Ubuntu 18.04 on my home server and i noticed that /etc/network/interfaces
file is empty. After searching on internet I found out that version 18.04 uses cloud-init
package to init networking and other stuff. I removed cloud-init package and configured interface in /etc/network/interfaces
for static IP but now after I reboot server it seems that networking is not configured before services startup because every service configured to listed on that interface fails to listen. After server is booted i have to manually run command service [name] start
. How do I fix this?
Interface config image
Solution 1:
Ubuntu has changed the tooling behind its network configuration, and that's what you're running into now with your 18.04 system. The new system is Netplan, and /etc/network/interfaces
and the related ifupdown
tools have been deprecated.
Since you removed cloud-init it's not really the problem here. You have two ways to move forward - you can either 1) configure Netplan with your static IP info; or 2) re-install the legacy ifupdown
package and use it like you used to.
To configure Netplan, remove the config file that cloud-init probably left behind:
rm /etc/netplan/50-cloud-init.yaml
And then create a new config file named something like /etc/netplan/99_config.yaml
and adapt one of the config file examples found here.