Setting up Wi-Fi via NetworkManager: A Complete Guide

In the world of Linux-based operating systems, managing network connections has long ceased to be the domain of select administrators who know the syntax by heart. ifconfig And iwconfig. The de facto modern standard has become NetworkManager — a powerful daemon that takes care of all the routine tasks of network discovery, profile management, and automatic reconnection when the connection is lost. For many users switching from Windows or macOS, this tool becomes the bridge between the complex command line and a familiar graphical interface.

However, despite its prevalence, the process of connecting to a wireless network Wi-Fi This can be challenging, especially in server builds or minimalist distributions lacking graphical applets. Understanding the operation of the daemon and its utilities allows you not only to quickly set up your internet connection but also to effectively diagnose problems that often arise when working with wireless adapters from various manufacturers.

In this guide, we'll cover all available methods of interacting with NetworkManager: from graphical menus in popular desktop environments to advanced terminal commands. You'll learn how to create persistent connection profiles, manage passwords, and configure security settings, making your Linux experience stable and predictable regardless of your chosen distribution.

NetworkManager architecture and its role in the system

At the core of the entire system is a background daemon process that constantly monitors the status of network interfaces. It doesn't simply turn Wi-Fi on and off, but manages complex priority logic: if wired Ethernet is available, it can disable the wireless connection to save power or prevent routing conflicts. NetworkManager stores connection configuration in separate files, usually located in the directory /etc/NetworkManager/system-connections/, which makes it easy to back up settings or transfer them to other machines.

It is important to understand the difference between interface state and connection state. An interface (e.g., wlan0) is a physical or virtual device, and a connection is a set of parameters (SSID, password, IP address) applied to that device. The daemon allows multiple profiles for a single interface, automatically selecting the appropriate one based on the availability of nearby networks.

Various backends and interfaces exist for interacting with the daemon. Graphical user interfaces (GUIs) use D-Bus to transmit commands, while text-based utilities can communicate with the daemon directly or via libnm. The key feature is that changes made through one interface (e.g. terminal) are instantly reflected in all others, ensuring state synchronization.

⚠️ Attention: Some distributions may have competing services installed by default, such as systemd-networkd or NetplanActivating multiple network managers simultaneously can cause unpredictable interface behavior. Ensure that NetworkManager is the only active management service.

How to check if the daemon is running?

To check the service's status, run the command systemctl status NetworkManager . If the service is active, you'll see the line "active (running)." If not, start it with systemctl start NetworkManager and add it to startup with the enable command.

Connection via graphical interface (GUI)

For users of desktop environments such as GNOME, KDE Plasma, XFCE, or Cinnamon, the connection process is simplified and visualized. Typically, there's a network icon in the system tray (notification area) that, when clicked, opens a list of available wireless networks. This is the most intuitive method, requiring no command knowledge.

After selecting the desired SSID (network name), the system will ask you to enter a password. NetworkManager Automatically detects the encryption type (WPA2/WPA3) and applies the appropriate settings. If the network is hidden, you'll need to manually enter the name and select the security type. In the advanced settings, you can set a static IP address, DNS servers, and proxy server settings.

The graphical interface also allows you to manage profiles: delete old connections, edit security settings, or customize behavior when connecting to public networks (the "public" mode limits your computer's visibility to other devices). All changes are saved immediately and applied the next time you connect.

  • 📶 System tray: Clicking on the network icon displays a list of available access points with signal strength.
  • 🔒 Safety: Automatic detection of encryption type and storing keys in the keyring.
  • ⚙️ Settings: the ability to manually configure IP, DNS and MTU without using a terminal.
📊 Which interface do you prefer?
Graphical (GUI)
Text (TUI)
Command line (CLI)
I don't care

Using nmtui utility for configuration in terminal

If a graphical interface is not available (for example, on a server or in a minimalist build), but you need a visual cue, the utility is the ideal solution nmtui (NetworkManager Text User Interface). It is a keyboard-driven, pseudo-graphical menu that eliminates the need to memorize complex command syntax.

To launch, simply enter the command nmtui in the terminal as a user with superuser rights (usually through sudo). In the menu that opens, select "Activate a connection." A list of available Wi-Fi networks will open, where you can select the desired one, enter the password, and confirm the action. The interface supports navigation with arrow keys and selection with the Enter key.

Advantage nmtui Its simplicity and low resource requirements make it ideal for quick initial system setup, after which you can switch to automatic management. This menu also makes it easy to delete old profiles or edit existing connection settings, which is convenient if you frequently change network environments.

☑️ Check before connecting via nmtui

Completed: 0 / 4

Managing Wi-Fi via the command line (nmcli)

For system administrators and automation enthusiasts, the most powerful tool is nmcli (NetworkManager Command Line Interface). This utility allows you to perform any actions available in the GUI, but using text commands, making it ideal for scripting and remote management via SSH.

The first step is always to scan for available networks. The command nmcli device wifi list will display a table with all visible access points, their frequency, channel, signal strength, and security flag. If the list is empty, the Wi-Fi adapter may be disabled programmatically—in this case, the following command will help: nmcli radio wifi on.

To connect directly, use the command nmcli device wifi connectThe syntax requires the SSID and password. For example: nmcli device wifi connect"MyHomeWiFi" password"SecretPassword123"After successful entry, the system will create a new connection profile and attempt to obtain an IP address via DHCP. If an error occurs, a detailed message will be displayed to help diagnose the problem (incorrect password, weak signal, missing driver).

nmcli device wifi connect"Office_Guest" password"GuestPass2026" ifname wlan0

It is important to note that nmcli Allows you to manage specific device settings. You can disable network scanning to save resources, change the MAC address for anonymity, or force a channel switch. All changes are applied instantly and can be verified with the command nmcli connection show, which displays the status of all known profiles.

⚠️ Attention: When entering passwords on the command line using nmcli, remember that commands are saved in the shell history. If the system is used by multiple users, the password may be visible in the file. ~/.bash_history. Use the option --ask for secure input.

Troubleshooting and log analysis

Even with proper setup, situations may arise where the connection is impossible or unstable. The first diagnostic tool should be the device status. nmcli device status will show the general status: connected, disconnected, unavailable, or missing driver. The "unmanaged" status indicates that NetworkManager is ignoring this device, possibly due to settings in the configuration files.

For in-depth analysis, logs are required. Modern distributions with systemd use a journal. journald. Team journalctl -u NetworkManager -f This will allow you to see daemon messages in real time. Look for keywords like "fail," "error," "secret," or "firmware." Problems are often related to missing proprietary firmware files for wireless cards, especially Broadcom or older Realtek models.

It's also worth checking for IP address conflicts and DNS settings. If you have a connection but can't access websites, try setting public DNS servers (e.g., Google 8.8.8.8 or Cloudflare 1.1.1.1) using nmcli or the graphical interface. Resetting NetworkManager settings may also help: deleting connection files in /etc/NetworkManager/system-connections/ forces the system to rediscover networks.

nmcli status Description Possible solution
disconnected The device is ready but not connected Execute the connection command
unavailable The driver is missing or the device is turned off. Check rfkill and driver installation
failed Authentication or DHCP error Check your router password and settings
unmanaged NetworkManager does not manage the device. Check nm.conf for the presence of ignore

Automation and advanced use cases

NetworkManager supports the creation of scripts that are executed when the network status changes. This is useful for running specific services only when connected to a home network or for changing firewall settings in public areas. Scripts are placed in directories /etc/NetworkManager/dispatcher.d/ and are executed with root rights.

It is also possible to configure connection priorities. If you have several known networks (home, office, cafe), NetworkManager will automatically connect to the one with the highest priority or the one that appeared first in the list if the priorities are equal. You can change the priority via the parameter connection.autoconnect-priority in profile settings.

Corporate environments often require 802.1x authentication (WPA-Enterprise). NetworkManager fully supports this standard, allowing you to enter CA certificates, user certificates, and passwords. This ensures secure connections to protected corporate networks without the need to manually configure complex wpa_supplicant settings.

  • 🚀 Dispatcher scripts: Automatically launch tasks when connecting/disconnecting.
  • 🔝 Priorities: Flexible configuration of the order of preference of known networks.
  • 🏢 Enterprise: support for complex authentication schemes and certificates.

⚠️ Attention: Command-line interfaces and configuration file formats may vary slightly between versions of NetworkManager. Always consult the official documentation (man pages) for your version if standard commands don't work as expected.

Frequently Asked Questions (FAQ)

How do I forget a Wi-Fi network so it doesn't connect automatically?

To delete a network profile, use the command nmcli connection delete"Profile_Name"The profile name can be found through nmcli connection showOnce removed, the system will no longer attempt to connect to this network automatically, even if it is within range.

Why doesn't NetworkManager see my Wi-Fi adapter?

This is most often due to missing drivers or blocking via rfkill. Check the command output. rfkill listIf the adapter is blocked (soft block), unlock it with the command rfkill unblock wifiIf the driver is missing, you will need to install firmware packages for your card model.

Is it possible to use NetworkManager and wpa_supplicant at the same time?

NetworkManager uses wpa_supplicant as a backend for Wi-Fi, so they don't conflict and work together. However, manually running a separate instance of wpa_supplicant for an interface managed by NetworkManager is not recommended, as this will cause a control conflict.

How to create a Hotspot using NetworkManager?

In the graphical interface, this is done through the "Create Access Point Profile" menu. In the command line, use the command: nmcli device wifi hotspot ssid"MyHotspot" password"Secret123"This will create a virtual interface and start the DHCP server for clients.