Chapter 3. Getting started with NetworkManager
By default, RHEL 8 uses NetworkManager to manage the network configuration and connections.
3.1. Benefits of using NetworkManager
The main benefits of using NetworkManager are:
- Offering an API through D-Bus which allows to query and control network configuration and state. In this way, networking can be checked and configured by multiple applications ensuring a synced and up-to-date networking status. For example, the RHEL web console, which monitors and configures servers through a web browser, uses the NetworkManager D-BUS interface to configure networking, as well as the Gnome GUI, the nmcli and the nm-connection-editor tools. Each change made in one of these tools is detected by all the others.
- Making Network management easier: NetworkManager ensures that network connectivity works. When it detects that there is no network configuration in a system but there are network devices, NetworkManager creates temporary connections to provide connectivity.
- Providing easy setup of connection to the user: NetworkManager offers management through different tools — GUI, nmtui, nmcli.
- Supporting configuration flexibility. For example, configuring a WiFi interface, NetworkManager scans and shows the available wifi networks. You can select an interface, and NetworkManager displays the required credentials providing automatic connection after the reboot process. NetworkManager can configure network aliases, IP addresses, static routes, DNS information, and VPN connections, as well as many connection-specific parameters. You can modify the configuration options to reflect your needs.
- Maintaining the state of devices after the reboot process and taking over interfaces which are set into managed mode during restart.
- Handling devices which are not explicitly set unmanaged but controlled manually by the user or another network service.
Additional resources
- For more information on installing and using the RHEL 8 web console, see Managing systems using the RHEL 8 web console.
3.2. An overview of utilities and applications you can use to manage NetworkManager connections
You can use the following utilities and applications to manage NetworkManager connections:
-
nmcli
: A command-line utility to manage connections. -
nmtui
: A curses-based text user interface (TUI). To use this application, install theNetworkManager-tui
package. -
nm-connection-editor
: A graphical user interface (GUI) for NetworkManager-related tasks. To start this application, enternm-connection-editor
in a terminal of a GNOME session. -
control-center
: A GUI provided by the GNOME shell for desktop users. Note that this application supports less features thannm-connection-editor
. -
The
network connection icon
in the GNOME shell: This icon represents network connection states and serves as visual indicator for the type of connection you are using.
3.3. Using NetworkManager dispatcher scripts
By default, the /etc/NetworkManager/dispatcher.d/
directory exists and NetworkManager runs scripts there, in alphabetical order. Each script must be an executable file owned by root
and must have write permission
only for the file owner.
NetworkManager executes dispatcher scripts in /etc/NetworkManager/dispatcher.d/
in alphabetical order.
Additional resources
- For an example of a dispatcher script, see the How to write a NetworkManager dispatcher script to apply ethtool commands solution.
3.4. Loading manually-created ifcfg files into NetworkManager
In Red Hat Enterprise Linux 8, if you edit an ifcfg
file, NetworkManager is not automatically aware of the change and has to be prompted to notice the change. If you use one of the tools to update NetworkManager profile settings, NetworkManager does not implement those changes until you reconnect using that profile. For example, if configuration files have been changed using an editor, NetworkManager must read the configuration files again.
The /etc/sysconfig/
directory is a location for configuration files and scripts. Most network configuration information is stored there, with the exception of VPN, mobile broadband and PPPoE configuration, which are stored in the /etc/NetworkManager/
subdirectories. For example, interface-specific information is stored in the ifcfg
files in the /etc/sysconfig/network-scripts/
directory.
Information for VPNs, mobile broadband and PPPoE connections is stored in /etc/NetworkManager/system-connections/
.
By default, RHEL uses NetworkManager to configure and manage network connections, and the /usr/sbin/ifup
and /usr/sbin/ifdown
scripts use NetworkManager to process ifcfg
files in the /etc/sysconfig/network-scripts/
directory.
If you need the legacy network scripts to manage your network settings, you can manually install them. For details, see Section 1.5, “Legacy network scripts support in RHEL” . However, note that the legacy network scripts are deprecated and will be removed in a future version of RHEL.
Procedure
To load a new configuration file:
#
nmcli connection load /etc/sysconfig/network-scripts/ifcfg-connection_name
If you updated a connection file that has already been loaded into NetworkManager, enter:
#
nmcli connection up connection_name
Additional resources
-
NetworkManager(8)
man page — Describes the network management daemon. -
NetworkManager.conf(5)
man page — Describes theNetworkManager
configuration file. -
/usr/share/doc/initscripts/sysconfig.txt
— Describesifcfg
configuration files and their directives as understood by the legacy network service. -
ifcfg(8)
man page — Describes briefly theifcfg
command.