This tutorial explains what Linux NetworkManager is and how to manage it. Learn the tools and applications you can use to manage NetworkManager service.
What is NetworkManager?
NetworkManager is a dynamic network control and configuration daemon. Starting from RHEL 7, it provides the default networking service. It dynamically controls all networking devices and their connections. It keeps them up and active when they are available. It offers various tools and commands to configure and manage them.
Advantages or benefits of NetworkManager
It makes network management easy. If it detects a network device without a connection, it automatically creates a temporary connection and attaches it to the network device. This feature ensures that network connectivity works.
A connection is a collection of necessary settings (such as an IP address, subnet mask, default gateway, etc.) that a network device (such as an Ethernet card or a Wireless LAN card) needs to connect to the network.
To learn more about network devices and connections, you can check this tutorial.
It includes various tools that allow us to configure and manage connections easily. It allows us to configure IP addresses, default gateway, static routes, network aliases, DNS information, VPN connections, and many other connection-specific parameters.
It offers an API through D-BUS. Applications can use the API to query and control network configuration and state. For example, through D-BUS, an application checks the current state of an interface and changes it as per requirement.
It can maintain the state of devices after the reboot process. For example, if you change the state of an interface to up and configure NetworkManager to save the state then NetworkManager will automatically start the interface and change its state to up on the next reboot.
How to install NetworkManager
By default, NetworkManager is installed on RHEL.
Due to any reason, if it is not installed, you can use the following command to install it.
# yum install NetworkManager
Managing NetworkManager
On RHEL Linux, the systemctl command lists and manages the state of services. It supports many options. Some important options are the following.
status | List the current state of the service |
start | Start the service in the current session |
stop | Stop the service in the current session |
enable | Start the service at the boot time |
disable | Stop the service at the boot time |
Let’s use the above options to manage the NetworkManager service.
Viewing or checking the current state of the NetworkManager service.
The following command prints the current state of NetworkManager.
# systemctl status NetworkManager
If the output shows 'Active: active (running)', it means the service is up and running. If the output shows 'Active: inactive (dead)', it means the service is down and not running.
How to manage the NetworkManager service
The following command stops the NetworkManager service.
# systemctl stop NetworkManager
The following command starts the NetworkManager service.
# systemctl start NetworkManager
The following command starts the NetworkManager service at boot time.
# systemctl enable NetworkManager
The following command stops the NetworkManager service at boot time.
# systemctl disable NetworkManager
NetworkManager tools and applications
NetworkManager offers five utilities to configure network devices and connections. These utilities are nmcli, nmtui, control-center, nm-connection-editor, and network connection icon.
Let's discuss these utilities in detail.
The nmcli utility
This utility provides a command line interface for NetworkManager. It uses the nmcli command to control and configure all aspects of network devices and connections. The nmcli command does not need a GUI environment to run. Generally, administrators do not install a GUI environment on Linux servers. If GUI is not installed, you can use the nmcli command to manage and configure all network devices and their connections.
The nmtui utility
The nmtui utility provides a curses-based text user interface for NetworkManager. If you find working with the command line a bit difficult, you can use this utility to configure network devices.
The control-center
The GNOME shell provides this utility for NetworkManager. It is available only for desktop users. It is known as the Network Settings tool. It does not include the advanced features of NetworkManager. You can use it to control and manage the basic functions of NetworkManager.
The nm-connection-editor
This utility provides a graphical user interface for NetworkManager. It includes all the important features of NetworkManager. It has the same functionality as the nmtui tool. You can use it to add, remove, and modify network connections.
The network connection icon
The GNOME shell provides this utility. You can use this utility to view the current state of the network device and the connection you are currently using. You can also use it to perform some essential tasks such as starting and stopping the network device that is currently in use.
The following table compares all five tools.
Utility | Interface | Availability | Operation | Supported features |
nmcli | CLI | On all platforms | Complex | All |
nmtui | Text-based tool | CLI/Desktop | Hard | Most |
nm-connection-editor | GUI | only on Desktop | Easy | Most |
control-center | GUI | only on Desktop | Easy | Some |
network connection icon | GUI | only on Desktop | Easy | Basic |
That’s all for this tutorial. In this tutorial, we learned what Linux NetworkManager is and how to manage it.