Ubuntu Server 18.04 – Understanding NetworkManager

How to Activate Windows Server 2019

NetworkManager is a utility for managing network connectivity on your server, though it’s not for everyone, and has largely been replaced with Netplan. This utility comes installed by default with older versions of Ubuntu Server, but it may not be included even on older versions if you’re using a cloud appliance. Therefore, feel free to skip this section if you’re not using a legacy version of Ubuntu Server as this won’t apply to you otherwise.

NetworkManager is a service (also known as daemon) that runs in the background and manages your network connections. On a desktop Linux distribution, it does everything from managing connectivity, to managing your wireless networks. With it, you can configure profiles, and create custom connections you can switch between.

On servers, the added features of NetworkManager on a desktop distribution aren’t all that useful, but the network connectivity management portion certainly is. With NetworkManager, it keeps an eye on whether or not your server is connected to a network. It even goes as far as to launch your DHCP client when network connectivity is started or restored, to facilitate the fetching of a dynamic IP address. If your network connection drops for any reason, NetworkManager will request a dynamic address as soon as it comes back online.

If you’re not using DHCP however, NetworkManager is of little benefit. The best rule of thumb in my opinion is to use NetworkManager when you’re using DHCP for IP assignments on older servers and to disable it otherwise.

Stopping and disabling NetworkManager can be done with the following commands (which you should only do if you’ve set up a manual static IP assignment):

sudo systemctl stop NetworkManager
sudo systemctl disable NetworkManager
sudo systemctl restart networking

As I’ve mentioned before, my preferred approach is static leases via DHCP (in other words, DHCP reservations for servers). The added benefit of static leases is that you benefit from being able to utilize NetworkManager. It will keep your connection alive, and any time it reaches out for an IP address, your server will always get the address you’ve set aside for it in your DHCP server. (Again, we’ll go over how to set this up in Chapter 7, Setting Up Network Services). In situations where you need to set up a static IP, you may as well just disable NetworkManager because it may just get in your way.

Regarding the desktop version of Ubuntu, NetworkManager is a great asset. It allows you to easily manage Wi-Fi networks, VPN connections, wired network profiles, and more in one easy to use graphical tool. For servers though, NetworkManager isn’t as useful in most cases.

Comments are closed.