Linux – Netplan configuration is not persistent

linuxlinux-networkingnetplannetworkingUbuntu

I have configured my network interfaces in my Ubuntu bionic (18.04) server using netplan, and afterwords I ran netplan apply and the configuration kicked in.
In particular, I configured the DNS servers, and my server did resolved ips with the nameservers I configured in my netplan configuration.

But, after reboot, the configuration didn't last and any resolving was by default to the 127.0.0.53 nameserver. Only after running netplan apply the configuration kicked in again.

How can I make the netplan configuration persistent to reboots?

Output of cat /etc/*-release:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

Best Answer

Typically once netplan configurations are written to /etc/netplan these will be persistent over reboots. Although I have seen issues where the netplan apply doesnt complete as expected when the interface is active. I have found adding --debug to the apply to be useful to see what is really happening

sudo netplan --debug apply

Related Topic