Ubuntu – Ubuntu 18.04 Static IP with NetPlan require reboot

18.04networking

I need to provide OVA with static IP.

I'm using clean Ubuntu 18.04 image and running (testing) on virtual box and vmware.

When I configure the IP address in the yaml file, and running the command:

sudo netplan apply  

Nothing changes.

Only when I reboot the machine, the IP address changes.

This is what inside my yaml:

network:
  version: 2 
  renderer:
  ethernets:
    enp0s3:
      dhcp4: no
      addresses: [10.0.2.100/24]
      gateway4: 10.0.2.1
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]

Typically, Linux does not require rebooting.
Please help me.

@heynnema

Best Answer

  • I had the same issue with my machine. It was an issue with the renderer, it is documented that Ubuntu server should come with networkd but in my machine (Ubuntu Server 18.04) the network manager that installed is network-manager so I changed the renderer to NetworkManager and it started to work again.

    You can check if network-manager is installed by sudo service network-manager status.

    I still don't know why network-manager is installed instead of networkd but at least it is working for me now.

  • Related Question