Chapter 2. Getting started with NetworkManager
By default, RHEL uses NetworkManager to manage the network configuration and connections.
2.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.
2.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 the
nm-connection-editor: A graphical user interface (GUI) for NetworkManager-related tasks. To start this application, enter
nm-connection-editorin 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 than
network connection iconin the GNOME shell: This icon represents network connection states and serves as visual indicator for the type of connection you are using.
2.3. Loading manually-created ifcfg files into NetworkManager
In Red Hat Enterprise Linux, 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.
NetworkManager supports profiles stored in the key file format. However, by default, NetworkManager uses the
ifcfg format when you use the NetworkManager API to create or update profiles.
In a future major RHEL release, the key file format will be default. Consider using the key file format if you want to manually create and manage configuration files. For details, see Manually creating NetworkManager profiles in key file format.
/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
Information for VPNs, mobile broadband and PPPoE connections is stored in
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