Understanding Linux Network Manager Fundamental

NetworkManager is a dynamic network control and configuration tool. It was developed in 2004 to simplify network configuration and management for desktop users. Before it, network configuration was static and managed through text files.

Managing configuration via text files was a complex task. You must manually update all related configuration files for every change. Since configuration files had to be updated manually, there was a possibility of errors.

Let us take an example.

You have a laptop. You want to use it at the two locations. The first location has a wired network, while the second has a wireless network. At the first location, you need to use a wired connection. At the second location, you have to use a wireless connection. Since both connections are different, you must update configuration files each time you switch the connection. It makes network management complex and tedious.

NetworkManager solves these issues. It automatically reconfigures network interfaces and routes and authenticates with the wireless network. It dynamically controls all networking devices and their connections and keeps them up and active when they are available.

It queries the Hardware Abstraction Layer (HAL) at startup to learn about the available network devices, reads their configuration files, and applies the applicable settings. 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) uses to connect to the network.

It includes various tools that allow us to easily configure and manage connections. These tools allow us to configure IP addresses, default gateways, static routes, network aliases, DNS information, VPN connections, and 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 can check the current state of an interface and change it as needed.

It can maintain the state of devices after the reboot process. For example, you can change the state of an interface to UP and configure NetworkManager to save the state. In that case, NetworkManager will automatically start the interface and change its state to UP on the next reboot.

How to install NetworkManager

NetworkManager is part of the default installation. You do not need to install it separately. If you have uninstalled it, you can use the following command to install it again.

#dnf install NetworkManager

Default NetworkManager

NetworkManager uses the /etc/NetworkManager directory to store configuration files.

Listing NetworkManager file

It uses the dispatcher service to track network events and execute scripts (actions) on them. The following command displays its manual pages.

#man 8 NetworkManager-dispatcher

dispatcher

The dispatcher service executes scripts in alphabetical order. It accepts two arguments: the device name for the event and the action.

There are many actions you can perform. The main actions for an interface are the following.

  • pre-up: The interface is connected to the network but has yet to be activated. It will activate after running this script.
  • up: The interface has been activated.
  • pre-down: It has deactivated the interface but not disconnected it from the network. It will disconnect it after executing this script. In the case of forced disconnections, it will not execute this script.
  • down: The interface has been deactivated.

The vpn-up, vpn-down, vpn-pre-up, or vpn-pre-down are similar to the preceding interfaces but for VPN connections.

Conclusion

NetworkManager is the default utility for managing and monitoring network connections on RHEL. It automatically reconfigures network devices when the system changes the network.

ComputerNetworkingNotes Linux Tutorials Understanding Linux Network Manager Fundamental

We do not accept any kind of Guest Post. Except Guest post submission, for any other query (such as adverting opportunity, product advertisement, feedback, suggestion, error reporting and technical issue) or simply just say to hello mail us ComputerNetworkingNotes@gmail.com