# NetworkManager

> Source: Courseiva IT Certification Glossary — https://courseiva.com/glossary/networkmanager

## Quick definition

NetworkManager is a tool that helps your computer automatically connect to the internet, whether you're using a cable, Wi-Fi, or a mobile hotspot. It keeps track of your network settings and switches between connections when needed, so you don’t have to manually configure things every time. Think of it as a smart assistant that makes sure your network just works.

## Simple meaning

Imagine you have a smartphone that can switch from your home Wi-Fi to mobile data when you walk out the door, and then reconnect to your office Wi-Fi when you arrive. NetworkManager does a similar job for Linux computers. It is a background service that constantly watches for available networks, remembers your passwords and preferences, and automatically connects you to the best or most familiar network. 

 You don’t need to be a networking expert to use it. When you plug in an Ethernet cable, NetworkManager detects it and assigns an IP address using DHCP, so you can browse the web instantly. When you move to a new Wi-Fi zone, it scans for known networks and logs you in without asking. For IT learners, NetworkManager is the default way to manage network interfaces on most modern Linux distributions, replacing older, manual methods that required editing files and running commands by hand. 

 One key thing to understand is that NetworkManager does not replace the low-level Linux networking stack. It sits on top of it, managing tools like dhclient, wpa_supplicant, and ip commands. It provides a consistent interface whether you use a graphical desktop environment, a text-based terminal with nmtui, or command-line tools like nmcli. This makes it a versatile tool for both desktop users and server administrators who need to manage network connections efficiently.

## Technical definition

NetworkManager is a daemon-based service designed to simplify network configuration on Linux and other Unix-like operating systems. It operates as a systemd service, typically named NetworkManager.service, and provides a D-Bus API that allows various front-end tools and applications to interact with it. The core architecture consists of the NetworkManager daemon, which manages network devices and connections, and several plugins that handle specific tasks such as DHCP, DNS, and VPN integration. 

 When NetworkManager starts, it scans all available network interfaces, including Ethernet, Wi-Fi, and mobile broadband. It maintains a connection profile database, usually stored in /etc/NetworkManager/system-connections/, where each profile contains settings like SSID, security keys, IP addressing method (DHCP or static), DNS servers, and routing rules. These profiles are prioritized based on the user’s network history and autoconnect preferences. 

 For wired connections, NetworkManager uses a built-in DHCP client or interfaces with dhclient or dhcpcd to obtain an IP address dynamically. For wireless connections, it leverages wpa_supplicant to handle authentication (WPA2, WPA3, enterprise 802.1X) and scanning. NetworkManager also manages DNS resolution by integrating with systemd-resolved or by updating /etc/resolv.conf directly. It can handle multiple active connections simultaneously, bonding, bridging, and even VPN tunnels via plugins like NetworkManager-openvpn or NetworkManager-libreswan. 

 In enterprise or server environments, NetworkManager is often used with the command-line tool nmcli for scripting and automation. Administrators can create connections with specific parameters, set connection priorities, and control autoconnect behavior. NetworkManager also supports policy-based routing and can be configured to ignore certain interfaces (e.g., for containers or bridges) using the unmanaged-devices option. Its ability to provide a consistent, declarative configuration layer makes it a standard tool in Red Hat Enterprise Linux, Fedora, Ubuntu, and many other distributions.

## Real-life example

Think of NetworkManager as a professional concierge at a large hotel. When you arrive, the concierge already knows your preferences-maybe you like a quiet room with a view, or you prefer to park on the west side. Without you having to explain everything each time, the concierge arranges your stay seamlessly. 

 In the same way, when you plug your Linux laptop into an Ethernet dock at work, NetworkManager recognizes that you are on the corporate network, applies the correct proxy settings, and sets up a static IP if required. When you take that same laptop to a coffee shop, the concierge (NetworkManager) scans the area, finds the coffee shop’s Wi-Fi, and if it is a network you have used before, connects you without any prompts. If it is a new network, it politely asks for a password, remembers it, and uses it the next time. 

 The concierge also handles changes elegantly. If your Wi-Fi signal weakens near a wired port, NetworkManager can switch to Ethernet without dropping your video call. This is similar to how a good concierge might suggest a better route when a road is closed. NetworkManager manages the complexity of multiple network interfaces, roaming, and reconnection so that you, the user, can focus on your work. For IT professionals, this means less time troubleshooting network cables and more time on higher-value tasks.

## Why it matters

NetworkManager is a critical tool for any IT professional because network connectivity is the foundation of almost everything in modern computing. Without reliable network management, servers cannot communicate, users cannot access resources, and automated deployments fail. NetworkManager reduces the burden of manual configuration, which is especially important in environments with dozens or hundreds of machines. 

 In practice, NetworkManager allows system administrators to centrally manage network settings through tools like nmcli or the GNOME Settings GUI. This consistency eliminates many common errors like misconfigured IP addresses, incorrect DNS servers, or duplicate default gateways. For example, when deploying a new Linux server in a data center, an admin can script nmcli commands to configure bonded interfaces, VLANs, or teaming, saving hours of manual work. 

 NetworkManager also improves user experience in dynamic environments. Laptops that move between home, office, and public Wi-Fi rely on NetworkManager to switch networks without interrupting workflows. In server farms, NetworkManager can be configured to manage only specific interfaces, leaving others for container networking or hypervisor management. Its support for VPNs and enterprise authentication (like 802.1X) makes it suitable for security-conscious organizations. Understanding NetworkManager is essential because many Linux certification exams, including LPIC, Red Hat, and CompTIA Linux+, test its commands and concepts extensively.

## Why it matters in exams

NetworkManager appears frequently in Linux certification exams such as LPIC-1 (101-500), Red Hat Certified System Administrator (RHCSA, EX200), CompTIA Linux+ (XK0-005), and the Linux Foundation Certified System Administrator (LFCS). In these exams, you are expected to know how to install, start, stop, and enable the NetworkManager service using systemctl. You must also be comfortable using nmcli to view device status, manage connections, and create new configurations. 

 For RHCSA, one of the core objectives is configuring networking using NetworkManager, which includes setting static IP addresses, adding DNS servers, and bringing interfaces up or down. Exam questions often present a scenario where you need to modify a connection profile or troubleshoot a missing route. You might be asked to use nmcli con modify to change an IP address or nmcli device connect to activate a Wi-Fi interface. 

 In CompTIA Linux+, the exam objectives explicitly mention managing network configurations with NetworkManager and understanding the differences between NetworkManager, systemd-networkd, and traditional ifup/ifdown scripts. Multiple-choice questions may test your knowledge of the location of connection profile files (/etc/NetworkManager/system-connections/) or the purpose of the nmcli general status command. 

 LPIC-1 also expects candidates to understand NetworkManager's role in modern distributions, although the exam may also include traditional networking tools. You could see a question about which daemon manages network interfaces in a default Ubuntu or Fedora installation. The correct answer is NetworkManager, not an obsolete tool like ifconfig. These exam topics emphasize that NetworkManager is not just a convenience tool but a fundamental component of Linux networking management.

## How it appears in exam questions

Exam questions about NetworkManager generally fall into three categories: command-based, scenario-based, and troubleshooting. Command-based questions might ask: “Which command shows the status of all network connections managed by NetworkManager?” The answer is nmcli connection show. Another variant could be: “What file stores persistent connection profiles for NetworkManager?” The correct answer is /etc/NetworkManager/system-connections/. 

 Scenario-based questions present a situation where an administrator needs to configure a static IP address on a server. For example: “A Linux server uses DHCP but needs a static IP of 192.168.1.100 with subnet mask 255.255.255.0 and gateway 192.168.1.1. Using nmcli, what command modifies the existing connection?” The answer involves nmcli con modify eth0 ipv4.addresses 192.168.1.100/24 and nmcli con modify eth0 ipv4.gateway 192.168.1.1 followed by nmcli con down eth0 && nmcli con up eth0 to apply changes. 

 Troubleshooting questions often test your ability to diagnose connectivity issues. For example: “A user cannot connect to the internet. The interface shows an IP address but cannot ping the gateway. What command should you use to check if NetworkManager is running?” The answer is systemctl status NetworkManager. Another common troubleshooting scenario involves the case where NetworkManager is not managing a specific interface. The question might ask: “How can you verify that NetworkManager has not excluded an interface in its configuration?” The answer is to check /etc/NetworkManager/NetworkManager.conf for unmanaged-devices settings and verify that the interface is not listed there. These patterns show that exam authors want you to not only memorize commands but also understand the logic behind managing and troubleshooting networks with NetworkManager.

## Example scenario

You are a junior IT administrator at a company that just deployed 20 new Linux workstations for the accounting department. Each workstation needs to be configured with a static IP address on the 192.168.10.0/24 subnet, with a default gateway of 192.168.10.1 and DNS servers 8.8.8.8 and 8.8.4.4. The network team has already assigned specific IP addresses to each workstation (e.g., 192.168.10.50 to .70). Your task is to automate this configuration using NetworkManager. 

 You begin by checking the current state of NetworkManager on one workstation using sudo systemctl status NetworkManager. It is active and running. Next, you list the existing connections with nmcli connection show. You see a single connection named ‘Wired connection 1’ on interface eth0. Instead of editing the existing connection interactively, you decide to create a new connection profile from scratch using nmcli. 

 You type: sudo nmcli con add type ethernet con-name accounting-ws50 ifname eth0 ipv4.addresses 192.168.10.50/24 ipv4.gateway 192.168.10.1 ipv4.dns 8.8.8.8 ipv4.method manual. This creates a new connection named accounting-ws50 with static configuration. After creating the profile, you activate it by disabling the old connection and enabling the new one: sudo nmcli connection down ‘Wired connection 1’ && sudo nmcli connection up accounting-ws50. You verify the configuration with nmcli device show eth0 and see the expected static IP, mask, gateway, and DNS. Then you repeat this process for the remaining 19 workstations, changing the IP address and connection name for each. By using nmcli in a script, you can complete the entire deployment in under an hour. This scenario demonstrates how NetworkManager’s command-line interface makes bulk network configuration efficient and consistent.

## Common mistakes

- **Mistake:** Assuming NetworkManager is only for desktop environments.
  - Why it is wrong: NetworkManager is often perceived as a GUI tool, but it works perfectly in headless servers via nmcli and nmtui. It is the default network manager in many server distributions like RHEL and Ubuntu Server.
  - Fix: Learn to use nmcli commands for server management, including creating, modifying, and deleting connections from the terminal.
- **Mistake:** Forgetting to restart the connection after a modification.
  - Why it is wrong: When you change a connection profile using nmcli con modify, the changes are not applied until the connection is deactivated and reactivated. This leads to confusion when the expected IP address does not appear.
  - Fix: Always run nmcli connection down <name> && nmcli connection up <name> after modifying a connection profile to apply the changes immediately.
- **Mistake:** Confusing nmcli device and nmcli connection commands.
  - Why it is wrong: nmcli device manages physical or virtual interfaces, while nmcli connection manages saved profiles. A common error is using nmcli device modify to change IP settings, which is not valid. The correct approach is to modify the connection profile.
  - Fix: Remember: you create and modify connections (profiles), not devices. Use nmcli connection show to see profiles and nmcli device status to see interface states.
- **Mistake:** Disabling NetworkManager without an alternative.
  - Why it is wrong: Some administrators disable NetworkManager because they prefer manual configuration via /etc/network/interfaces or systemd-networkd. However, on distributions that rely on NetworkManager, disabling it can break network connectivity, especially for wireless or VPN setups.
  - Fix: If you need to disable NetworkManager, ensure another network manager (like systemd-networkd) is configured and enabled first. Alternatively, you can configure NetworkManager to ignore specific interfaces while managing others.
- **Mistake:** Not checking for unmanaged devices in NetworkManager.conf.
  - Why it is wrong: If an interface does not appear in nmcli device status, it may be listed as unmanaged in /etc/NetworkManager/NetworkManager.conf. Assuming the interface is broken leads to wasted troubleshooting time.
  - Fix: Check the [keyfile] section of NetworkManager.conf for unmanaged-devices and verify that the interface is not excluded. You can also run nmcli device show <interface> to see the management status.

## Exam trap

{"trap":"Using 'ifconfig' or 'route' commands to verify NetworkManager configurations.","why_learners_choose_it":"Many learners are taught the older tools like ifconfig and route because they are simple and have been around for decades. In an exam, these commands might still show valid output, but they do not reflect the state managed by NetworkManager, especially for dynamic interfaces like wireless or VPNs.","how_to_avoid_it":"Use ip addr show and ip route show instead of ifconfig and route. Also, always use nmcli device show or nmcli connection show to verify NetworkManager-specific settings. Remember that ifconfig may show a different IP if NetworkManager has not applied its configuration to the kernel yet."}

## Commonly confused with

- **NetworkManager vs systemd-networkd:** systemd-networkd is a systemd service that also manages network interfaces, but it is more lightweight and often used in containers or minimal server environments. It relies on .network, .link, and .netdev files in /etc/systemd/network/ instead of the connection profile approach of NetworkManager. On many distributions, they can coexist, but typically only one is used to manage an interface. (Example: In a Docker container host, systemd-networkd may manage the host’s Ethernet, while NetworkManager handles user-configurable connections on a desktop.)
- **NetworkManager vs Wicd:** Wicd is an older network manager that was popular before NetworkManager became standard. It uses a different configuration format and a less extensive feature set. Wicd does not support modern features like VPN integration or policy-based routing as well as NetworkManager. It is rarely used in current distributions. (Example: An outdated Linux textbook might mention Wicd, but in practice, all major distributions now default to NetworkManager or systemd-networkd.)
- **NetworkManager vs ifup/ifdown scripts:** The traditional /etc/network/interfaces method uses ifup and ifdown commands to bring interfaces up or down based on static configuration files. This approach is static and does not handle dynamic network changes, scanning, or automatic switching. NetworkManager supersedes this for dynamic environments, though the scripts can still be used on some systems. (Example: On a Debian server without NetworkManager, you would edit /etc/network/interfaces and run ifup eth0. With NetworkManager, you use nmcli or the GUI and the interface is managed automatically.)

## Step-by-step breakdown

1. **Detection of Interfaces** — When NetworkManager starts, it scans all available network interfaces (wired, wireless, and others) using udev and kernel events. It detects new interfaces as they are added, such as plugging in a USB Ethernet adapter.
2. **Connection Profile Loading** — NetworkManager loads saved connection profiles from /etc/NetworkManager/system-connections/. Each profile contains parameters like SSID, security settings, IP configuration method (DHCP or static), DNS servers, and routing preferences.
3. **Automatic Connection Attempt** — For each detected interface, NetworkManager checks if there is a matching connection profile. If a profile exists with autoconnect enabled, it attempts to bring up that connection. For Ethernet, this usually happens immediately; for Wi-Fi, it scans and matches known networks.
4. **IP Address Configuration** — If the profile specifies DHCP, NetworkManager runs a DHCP client (internal or external) to obtain an IP address, netmask, gateway, and DNS servers. For static configurations, it assigns the specified address and routes directly.
5. **DNS and Routing Setup** — NetworkManager updates the system’s DNS configuration, typically by modifying /etc/resolv.conf or by updating systemd-resolved. It also adds the default route via the gateway. It can set up multiple routing tables if policy routing is required.
6. **Connection Monitoring and Roaming** — NetworkManager continuously monitors the connection quality. If a wired connection becomes active while Wi-Fi is connected, it can automatically switch to Ethernet based on priority. It also handles roaming between Wi-Fi access points and reconnects if the connection drops.
7. **Notification and User Feedback** — Through D-Bus signals, NetworkManager informs desktop environments and user applications about connection state changes. Icons may appear in the taskbar, or notifications pop up when a connection is established or lost.

## Practical mini-lesson

NetworkManager is a powerful utility that IT professionals need to master for both daily administration and certification exams. The first step is knowing how to check its status: sudo systemctl status NetworkManager shows whether the daemon is active. If it is not running, start it with sudo systemctl start NetworkManager. 

 For everyday use, nmcli is your primary tool. To see all network devices: nmcli device status. This shows device names (e.g., eth0, wlan0) and their state (connected, disconnected, unmanaged). To list all connection profiles: nmcli connection show. Profiles are the saved configurations, not the physical interfaces. If you need to see detailed information about a specific connection, use nmcli connection show <name>. 

 When configuring a static IP, use nmcli con modify to change an existing profile. For example: sudo nmcli con modify eth0 ipv4.addresses 192.168.1.10/24 ipv4.gateway 192.168.1.1 ipv4.dns 8.8.8.8 ipv4.method manual. After modification, always restart the connection with nmcli con down eth0 && nmcli con up eth0. For new connections, use nmcli con add with the same parameters. 

 One practical gotcha is that NetworkManager may override /etc/resolv.conf if it is managing DNS. If you want to use custom DNS that persists, set it in the connection profile. If you need to prevent NetworkManager from managing resolv.conf, you can set dns=none in /etc/NetworkManager/NetworkManager.conf. 

 In server environments, you might need to mark an interface as unmanaged, for example when using Docker bridges. Add the line unmanaged-devices=interface-name:docker0 to the [keyfile] section in NetworkManager.conf. Then restart NetworkManager. This tells NetworkManager to ignore that interface. Understanding these configurations helps avoid painful troubleshooting during real deployments and exam practicals.

## Commands

```
nmcli general status
```


```
nmcli connection show
```


```
nmcli device show eth0
```


```
nmcli connection modify eth0 ipv4.addresses 192.168.1.10/24
```


```
nmcli connection down eth0 && nmcli connection up eth0
```


```
nmcli connection add type ethernet con-name myserver ifname eth0 ipv4.method manual ipv4.addresses 192.168.1.10/24
```


## Troubleshooting clues

- **undefined** — symptom: Interface shows 'unmanaged' in nmcli device status. undefined
- **undefined** — symptom: nmcli command returns 'NetworkManager is not running'. undefined
- **undefined** — symptom: Changes to connection profile have no effect. undefined
- **undefined** — symptom: Wi-Fi option is missing in nmcli device status. undefined

## Memory tip

N-M-C-L-I = Network Manager Command Line Interface. Remember that 'nmcli' is your one-stop shop for controlling NetworkManager: connection show, device status, con modify, con add.

## FAQ

**Is NetworkManager only for wireless networks?**

No, NetworkManager manages all types of network interfaces, including Ethernet, Wi-Fi, mobile broadband, VPNs, and even bridges. It is the default network manager for most Linux desktop and server distributions.

**Can I use NetworkManager on a server without a graphical interface?**

Yes, absolutely. You can manage NetworkManager entirely from the command line using the nmcli tool or the interactive text-based UI nmtui. It works on headless servers without any GUI dependencies.

**How do I prevent NetworkManager from managing a specific interface?**

You can mark an interface as unmanaged by adding a line in /etc/NetworkManager/NetworkManager.conf under the [keyfile] section, like 'unmanaged-devices=interface-name:eth1'. Then restart NetworkManager.

**What is the difference between nmcli device and nmcli connection?**

nmcli device manages hardware or virtual interfaces (e.g., eth0, wlan0), showing their state and current configuration. nmcli connection manages saved connection profiles, which include all settings like IP addresses and security keys. You modify a connection, not a device.

**How do I set a static IP using NetworkManager?**

Use nmcli con modify <connection-name> ipv4.addresses <IP/netmask> ipv4.gateway <gateway> ipv4.dns <DNS> ipv4.method manual, then restart the connection with nmcli con down <name> && nmcli con up <name>.

**Why does NetworkManager sometimes overwrite my /etc/resolv.conf?**

By default, NetworkManager manages DNS resolution and writes to /etc/resolv.conf. If you want to prevent this, set 'dns=none' in the [main] section of /etc/NetworkManager/NetworkManager.conf and stop the systemd-resolved service if it is used.

## Summary

NetworkManager is an essential component of modern Linux systems that automates and simplifies network configuration. It manages wired, wireless, and virtual interfaces through a daemon that stores settings in connection profiles, making it easy to switch networks, apply static IPs, and troubleshoot connectivity. 

 For IT certification learners, understanding NetworkManager means being able to use nmcli and nmtui for configuration, knowing where profiles are stored, and recognizing how it interacts with the kernel and other services like wpa_supplicant and systemd-resolved. It is a core topic in RHCSA, CompTIA Linux+, and LPIC exams, where you will be asked to configure and troubleshoot network settings using its tools. 

 Beyond exams, NetworkManager is a practical skill for any Linux administrator. Whether you are deploying servers, managing laptops, or setting up containers, NetworkManager offers a consistent, scriptable interface that saves time and reduces errors. By mastering it, you ensure your systems stay connected reliably in any environment.

---

Practice questions and the full interactive page: https://courseiva.com/glossary/networkmanager
