On Ubuntu 18.04 LTS and Ubuntu 20, Netplan is available and replaced ifupdown by default. Let's say our interface is ens192. To check whether it's being managed by NetworkManager:
Which could output this:
# devices managed by networkd
Backup the configuration file (your path or file may be different):
cp /etc/netplan/01-netcfg.yaml /etc/netplan/01-netcfg.yaml.ori
/etc/netplan/01-netcfg.yaml to look something like:
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
Generate the output file with debug for extra details:
sudo netplan --debug generate
We'd like to see:
DEBUG:command generate: running ['/lib/netplan/generate']
** (generate:9991): DEBUG: 18:08:30.447: Processing input file //etc/netplan/01-netcfg.yaml..
** (generate:9991): DEBUG: 18:08:30.447: starting new processing pass
** (generate:9991): DEBUG: 18:08:30.448: ens192: setting default backend to 1
** (generate:9991): DEBUG: 18:08:30.448: Generating output files..
** (generate:9991): DEBUG: 18:08:30.449: NetworkManager: definition ens192 is not for us (backend 1)
We can see the actual configuration with:
Let's make it active by:
sudo systemctl restart systemd-networkd
Be prepared to lose the connection if doing this over SSH. Do
man netplan for details. There is also a related answer on this site. See also the documentation.