How to Change from NetworkManager to Networkd

By

By default, the desktop version of Ubuntu uses NetworkManager to configure and manage your network interfaces. NetworkManager provides a GUI, so in most desktop environments, it is the preferred way to handle networking.

The server edition of Ubuntu does not have a desktop environment installed by default, so NetworkManager is not possible and therefore not installed. In such system, systemd-networkd, also referred to as simply networkd, is used instead of NetworkManager. networkd is command-line only and does not have a GUI.

netplan is a command-line network configuration utility introduced in Ubuntu 17.10 to manage and configure network settings. netplan works together with the NetworkManager and systemd-networkd networking daemons, which are referred to as renderers. netplan allows you to choose which renderer to use.

Some users of the desktop version of Ubuntu that spend most of their time in shell might prefer networkd instead of NetworkManager. In this article, we will explain how to change the netplan renderer from NetworkManager to networkd.

Disable NetworkManager Services

First, we’ll disable the NetworkManager service and its related services. The method for disabling NetworkManager depends on your system.

Ubuntu 18.04 LTS and 20.04 LTS with GNOME

For Ubuntu 18.04 LTS and 20.04 LTS with GNOME desktop, you cannot simply remove and purge the network-manager package. Purging the network-manager package would also purge the ubuntu-desktop and gnome-control-center packages, which are essential parts of the GNOME desktop.

On such system, the NetworkManager service and other related services can be disabled by running the following commands:

sudo systemctl stop NetworkManager.service
sudo systemctl disable NetworkManager.service

sudo systemctl stop NetworkManager-wait-online.service
sudo systemctl disable NetworkManager-wait-online.service

sudo systemctl stop NetworkManager-dispatcher.service
sudo systemctl disable NetworkManager-dispatcher.service

sudo systemctl stop network-manager.service
sudo systemctl disable network-manager.service

Ubuntu MATE 18.04 LTS and 20.04 LTS

For Ubuntu MATE 18.04 LTS and 20.04 LTS, purging network-manager is safe. You can simply run the following command to remove and purge the network-manager package:

sudo apt purge network-manager

Edit Netplan Configuration

Netplan reads the network configurations in /etc/netplan/*.yaml and you can store configurations for all your network interfaces in these files.

Open the configuration file for netplan using a text editor such as nano:

nano /etc/netplan/config.yaml

Here is a sample output of the original configuration file with NetworkManager as the renderer:

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    enp2s0:
      dhcp4: yes

Change the renderer to networkd by updating the configuration file as follows:

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
# Set and change netplan renderer to NetworkManager GUI tool 
network:
  version: 2
  renderer: networkd
  ethernets:
    enp2s0:
      dhcp4: yes

Also, make any other changes that are required to configure your network interfaces.

Then, save your changes and close the file.

Apply the changes by running the following command:

netplan apply

Or you can simply reboot your system with the new renderer in effect:

reboot

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.