

"To configure netplan, save configuration files under /etc/netplan/ with a. Writing a new answer as so many are just wrong.ĭo not edit 50-cloud-init.yaml, 00-installer-config.yaml or ANY system generated files/package files.

If you want more info about Netplan there is a website, it has some basic configuration examples. If using a WLAN I have read that it is a bit more tricky to setup but I haven't yet set up a machine connected to WiFi with this server version. Check the ethernet cable, if in virtual review the VM configuration. Once you save the file, run sudo netplan -debug apply the debug flag will output more info and can help to detect any errors. Taking the information from your post, it should be like this: network:Īddresses: I have used this configuration with my Ubuntu Server virtual machine and it works so far, just make sure the info is correct the optional: true setting supposedly speeds up the booting time by not verifying if the interface is connected or not, this is default, also there is no need to declare values not used, for example DHCP, if they are absent they are taken as disabled, also the default renderer in Ubuntu Server is networkd so there is no need to declare it. Ubuntu 18.04 uses now Netplan to configure the network interfaces, so the configuration must be done in the file /etc/netplan/50-cloud-init.yaml, the documentation advises not to mess anymore with the old file /etc/network/interfaces. Note the use of the networkd renderer instead of NetworkManager because the configuration is on a server. Then you may end up with a file name /etc/netplan/01-netcfg.yaml which contains the configuration below. I suggest you to rename the file (not the right name since 50-cloud-init.yaml let us think it still uses CloudInit). Under Ubuntu 18.04.2 I had to use dpkg-reconfigure cloud-init to let it take into account the file /etc/cloud/cloud-init.disabled. So you should not edit that file but the one under /etc/cloud// if you still want to use CloudInit.Īnother way is to completely disable CloudInit first by creating an empty file /etc/cloud/cloud-init.disabled (see ) and then the other answers are OK. # /etc/cloud//99-disable-network-config.cfg with the following:

# To disable cloud-init's network configuration capabilities, write a file Changes to it will not persist across an instance. # This file is generated from information provided by In Ubuntu 18.04.2 it is clearly written inside the file : $ cat /etc/netplan/50-cloud-init.yaml All the answers telling you to directly edit /etc/netplan/50-cloud-init.yaml are wrong since CloudInit is used and will generate that file.
