What is Network Manager in Linux?

Learn via video courses
Topics Covered

Overview

In Linux, the Network Manager is a software utility that provides network management capabilities for the system. It is designed to simplify and automate the configuration of network connections, such as wired, wireless, and mobile broadband connections. Network Manager is a widely used tool in Linux distributions that use desktop environments such as GNOME, KDE, and Unity. It typically provides a graphical user interface (GUI) for managing network connections, but it can also be controlled via command-line tools and configuration files for advanced users.

In this article, we'll talk about how Network Manager Linux makes it easier to manage network connections on Linux systems by giving users an intuitive user interface and automating plenty of network-related chores.

How Network Manager Works?

Network Manager works by employing a modular architecture and a set of daemons and plugins to manage network connections in Linux-based operating systems. Let's explore the main components and the workflow of Network Manager:

  1. Network Manager Daemon:

    Network Manager runs as a background daemon (NetworkManager) that manages network connections on the system.

  2. Plugin System:

    It employs a plugin-based architecture, where each plugin handles specific network interfaces and connection types, such as Ethernet, Wi-Fi, Bluetooth, etc.

  3. Device Detection and Configuration:

    Network Manager detects and initializes network devices connected to the system, gathering information about their capabilities and status.

  4. Connection Initialization:

    When a user wants to connect to a network, Network Manager interacts with the appropriate plugin based on the connection type (e.g., Wi-Fi, Ethernet).

  5. Connection Negotiation and Authentication:

    It handles the negotiation process, scanning for available networks, authenticating with the network (e.g., WPA/WPA2 for Wi-Fi), and exchanging connection parameters.

  6. IP Address and DNS Configuration:

    Network Manager obtains an IP address for the device from the DHCP server or assigns a static IP, along with configuring DNS settings for the connection.

  7. Profile Management:

    It allows users to create and store network profiles containing settings for each network, simplifying configuration for known networks.

  8. Connection Prioritization and Failover:

    Network Manager enables users to define connection priorities or rules, automatically switching between available connections based on user preferences or predefined criteria.

  9. VPN Integration:

    It integrates with VPN technologies like OpenVPN, IPsec, and PPTP, facilitating the configuration and management of secure VPN connections.

Linux Network Manager Installation and Configuration

To install and configure Linux NetworkManager, you can follow these general steps:

1. Installation:

  • Open a terminal on your Linux system.

  • Use the package manager specific to your distribution to install NetworkManager.

    For example:

    • On Ubuntu or Debian: sudo apt-get install network-manager
    • On Fedora or CentOS: sudo dnf install NetworkManager
    • On openSUSE: sudo zypper install NetworkManager

2. Start and enable NetworkManager service:

  • After installation, start the NetworkManager service. The method may differ depending on your Linux distribution:
    • On systemd-based systems: sudo systemctl start NetworkManager On SysVinit-based systems: sudo service NetworkManager start
    • To ensure NetworkManager starts automatically at system boot:
    • On systemd-based systems: sudo systemctl enable NetworkManager On SysVinit-based systems: sudo chkconfig NetworkManager on

3. Configuration:

  • NetworkManager can be configured using either the graphical interface or the command-line tool 'nmcli.' Choose the method that suits your preference. Graphical Interface (for GNOME desktop environment):
  • Look for the network icon in the system tray and click on it.
  • Select "Wi-Fi Settings" or "Wired Settings" to configure the respective connections.
  • In the settings window, you can manage wireless networks, add new connections, and modify existing connections. Command-Line Configuration (using nmcli):
    • Open a terminal.

    • Use 'nmcli' to manage network connections. Here are a few common commands:

      • nmcli connection show: Displays a list of active network connections.
      • nmcli device wifi list: Lists available Wi-Fi networks.
      • nmcli device wifi connect password : Connects to a Wi-Fi network.
      • nmcli connection add type : Adds a new network connection.
      • nmcli connection modify : Modifies connection settings.
      • nmcli connection delete : Deletes a connection.

These are just a few examples of using 'nmcli' for network configuration. You can refer to the 'nmcli' manual (man nmcli) for detailed information on its usage and available commands.

Once installed and configured, Linux NetworkManager provides a user-friendly interface and powerful tools to manage your network connections effectively.

Usage of Network Manager

NetworkManager is a powerful network management daemon and command-line tool used in many Linux distributions to manage network connections. It provides a comprehensive set of features for configuring and controlling network interfaces.

Certainly! Let's go over an example of how to use the 'nmcli' command-line tool with NetworkManager. We'll show you how to set up and set up a wireless network connection in this example.

1. List available wireless devices:

This command will show a list of Wi-Fi networks that are accessible along with details about their SSIDs, signal levels, and security.

2. Connect to a Wi-Fi network:

Replace <SSID> with the name of the Wi-Fi network you want to connect to and <password> with the network's password. This command will initiate a connection to the specified Wi-Fi network.

3. Check the connection status:

This command will display a list of active network connections, including the newly created wireless connection.

4. Modify connection settings:

Replace <connection-name> with the name of the connection you want to modify, and <new-password> with the new Wi-Fi password. This command updates the Wi-Fi security settings and password for the specified connection.

5. Delete a connection:

Replace <connection-name> with the name of the connection you want to delete. This command removes the specified connection from NetworkManager.

These are just a few examples of the many tasks you can perform with NetworkManager and 'nmcli'. The tool offers a wide range of options for managing various types of network connections, including wired, wireless, mobile broadband, and VPN connections.

Linux Network Manager Tools

Linux Network Manager provides several command-line tools that allow users to interact with and manage network connections. Here are some of the commonly used tools:

1. nmcli: nmcli (Network Manager Command-Line Interface) is a powerful command-line tool for managing Network Manager. It provides a wide range of options to control and configure network connections. Some useful nmcli commands include:

  • nmcli connection shows Lists of available network connections.
  • nmcli connection up <connection_name>: Activates a network connection.
  • nmcli connection down <connection_name>: Deactivates a network connection.
  • nmcli device show: Shows information about network devices.

2. nmtui: nmtui (Network Manager Text User Interface) provides a text-based user interface for managing network connections. It offers a simple and easy-to-use interface to configure network settings. Users can navigate through the menus, select connections, and modify settings using keyboard inputs.

nmtui

3. nm-connection-editor: nm-connection-editor is a graphical tool that allows users to manage network connections through a graphical user interface (GUI). It provides an intuitive interface for creating, editing, and deleting network connections. Users can configure wired, wireless, and VPN connections and set IP addresses, DNS settings, and proxy configurations.

nm-connection-editor

4. NetworkManager Applet: NetworkManager Applet is a system tray icon that provides quick access to Network Manager settings and network connections. It allows users to connect to available networks, view connection status, and access network settings through a convenient GUI. The applet is typically included in desktop environments like GNOME, KDE, and Xfce. It is present in the top right corner as shown below,

nm applet

For managing network connections in Linux systems, these tools provide simplicity and versatility. You can use either the graphical user interfaces or the command-line tools offered by Network Manager to configure and manage network connections effectively, depending on your preferences and particular needs.

Benefits of Using Network Manager

Using Linux Network Manager provides several benefits that contribute to efficient and streamlined network management. Here are some key advantages:

1. Simplified Configuration:

Network Manager provides an intuitive user interface that makes setting up network connections simple. Users may set up and alter network settings quickly and easily without having to perform a lot of manual configuration work, thanks to the availability of both command-line and graphical tools. Users who are new to Linux or networking will find this simplification to be especially beneficial.

2. Centralized Network Manager:

A central tool for controlling different network connections, including wired, wireless, mobile broadband, and VPN. It creates a unified and consistent experience by combining the management of several network interfaces into a single tool. Through the elimination of the need to employ multiple utilities for various connection types, this centralized approach saves time and effort.

3. Automatic Connection Handling:

Network Manager automates several network connectivity-related processes. It facilitates quick and easy connection setup by automatically detecting and configuring network devices as they are connected. To minimize manual involvement and guarantee seamless connection formation, Network Manager also handles connection negotiation, authentication, and IP address/DNS configuration.

4. Logging and Troubleshooting:

Network Manager provides detailed logging capabilities, allowing users and administrators to troubleshoot network issues effectively. Log files capture events, errors, and debug information, helping diagnose and resolve connectivity problems. The logging feature assists in identifying configuration errors, network conflicts, or driver issues that may affect network performance.

Linux Network Manager makes network administration easier by delivering a user-friendly interface, centralizing setup and management responsibilities, automating connection handling, facilitating profile management, prioritizing connections, integrating with VPN technologies, and offering extensibility.

Learn More

  1. Network troubleshooting Tools in Linux : https://www.scaler.com/topics/network-troubleshooting-tools/
  2. Linux File System and Directory : https://www.scaler.com/topics/linux-tutorial/file-system-of-linux/

Conclusion

Linux Network Manager serves as a powerful and versatile tool for managing network connections in Linux-based systems. It simplifies network configuration, automates connection handling, provides profile management, supports prioritization and failover, integrates with VPN technologies, and offers flexibility for future network requirements. Here's a concise summary of the key points about Linux Network Manager:

  • Linux Network Manager is a network management tool for Linux-based systems.
  • It provides a user-friendly interface for configuring and controlling network connections.
  • Network Manager supports wired, wireless, mobile broadband, and VPN connections.
  • Users can easily configure network settings, connect to wireless networks, manage mobile broadband, and set up VPNs.
  • It offers features like network profile management, connection prioritization, and auto-connect functionality.
  • Network Manager integrates well with popular desktop environments.
  • The 'nmcli' command-line tool allows advanced users to perform network management tasks from the terminal.
  • Network Manager provides monitoring capabilities for network traffic and troubleshooting connectivity issues.
  • It is widely used and supported across various Linux distributions.
  • Overall, Linux Network Manager simplifies network management on Linux systems, enhancing the user experience and providing a reliable solution for both desktop and server environments.