NetworkManager is a system daemon that configures and maintains network connectivity on Linux. In Linux networking, it sits above the kernel networking stack and applies stored connection profiles to network devices: it brings interfaces up, obtains addresses through DHCP or SLAAC, sets routes and DNS servers, joins Wi-Fi networks and starts VPN tunnels, and it reacts automatically when cables, access points or docking stations change.
NetworkManager is the default network stack on Fedora, RHEL and its rebuilds, Ubuntu Desktop and most desktop distributions. It is controlled with the command-line client nmcli, the text interface nmtui and graphical applets, and it exposes a D-Bus API that other programs use to query and change the network state.
How NetworkManager manages connections
NetworkManager separates devices from connections. A device is a network interface the kernel knows, such as enp3s0 or wlp2s0. A connection profile is a stored set of settings, such as addresses, DNS, Wi-Fi credentials or VPN parameters, that can be activated on a compatible device. One device may have several profiles, for example office and home settings, and only one is active at a time.
When a device becomes available, NetworkManager selects the best matching profile with autoconnect enabled, ranked by autoconnect-priority and the most recent successful use. It then configures the kernel through netlink, the same interface the ip command uses, and runs its internal DHCP client or accepts router advertisements for IPv6.
| Concept | Meaning | Example |
|---|---|---|
| Device | A kernel network interface | enp3s0, wlp2s0, wg0 |
| Connection profile | Saved settings for one network | office-wired, home-wifi |
| Active connection | A profile currently applied to a device | home-wifi on wlp2s0 |
| Autoconnect | Automatic activation when possible | autoconnect yes, priority 10 |
| Dispatcher script | Hook run on state changes | Mount a share when the VPN comes up |
Connection types and profile storage
NetworkManager supports a broad range of connection types through built-in code and plugins, which is the main reason it dominates on laptops and workstations.
| Type | Typical use | Notes |
|---|---|---|
| Ethernet | Wired desktops and servers | Static or DHCP, 802.1X possible |
| Wi-Fi | Laptops and mobile devices | WPA2, WPA3, enterprise EAP, hotspot mode |
| Bond, bridge, team | Redundancy and virtualization hosts | Defined as master and port profiles |
| VLAN | Tagged network segments | Parent device plus VLAN ID 1-4094 |
| VPN | Remote access | WireGuard built in, OpenVPN and others via plugins |
| Mobile broadband | LTE and 5G modems | Works together with ModemManager |
Profiles are stored as keyfiles in /etc/NetworkManager/system-connections/, readable only by root because they may contain secrets. On RHEL 9 and recent Fedora releases, keyfiles are the default storage format, replacing the older ifcfg files in /etc/sysconfig/network-scripts/. Profiles created only for the current boot live in /run/NetworkManager/ and disappear on restart.
Working with nmcli
nmcli is the primary administrative interface and is fully scriptable. Changes made with nmcli connection modify are written to the profile but not applied until the connection is reactivated or nmcli device reapply is run.
| Command | Purpose |
|---|---|
| nmcli device status | Show devices and their state |
| nmcli connection show | List saved profiles |
| nmcli connection add type ethernet ifname enp3s0 | Create a new wired profile |
| nmcli connection modify office ipv4.addresses 10.0.0.5/24 | Change a profile setting |
| nmcli connection up office | Activate a profile |
| nmcli device wifi connect SSID –ask | Join a Wi-Fi network interactively |
| nmcli general logging level DEBUG | Raise log detail for troubleshooting |
Setting ipv4.method manual together with ipv4.addresses, ipv4.gateway and ipv4.dns produces a static configuration, while ipv4.method auto uses DHCP. The setting ipv4.ignore-auto-dns yes keeps DHCP addressing but replaces the DNS servers with manually chosen ones.
NetworkManager compared with other network tools
Linux offers several layers of network configuration, and they are often confused. NetworkManager is a persistent, event-driven daemon, whereas the ip command changes the kernel state directly and Netplan only generates configuration for a back end.
| Tool | Role | Persistence | Typical environment |
|---|---|---|---|
| NetworkManager | Daemon applying profiles | Profiles survive reboots | Desktops, laptops, RHEL servers |
| ip command | Direct kernel configuration | Lost at reboot | Diagnostics and quick changes |
| Netplan | YAML generator for a back end | Renders to NetworkManager or networkd | Ubuntu |
| systemd-networkd | Lightweight network daemon | Declarative .network files | Servers, containers, appliances |
| nftables, iptables, UFW | Packet filtering | Separate rule sets | Firewalls, not addressing |
NetworkManager does not filter traffic. On Fedora and RHEL it cooperates with firewalld by assigning each connection a firewall zone through the connection.zone property, and the actual rules are then enforced by nftables.
DNS handling and common pitfalls
NetworkManager decides how /etc/resolv.conf is managed through the dns and rc-manager settings. It may write the file directly, hand DNS servers to systemd-resolved, or run a local dnsmasq instance for split DNS with VPNs. Unexpected DNS behavior almost always traces back to which of these modes is active.
- Editing
/etc/resolv.confby hand is overwritten on the next change; set DNS in the profile instead. - Running NetworkManager and systemd-networkd on the same interface causes both to fight over addresses.
- Interfaces listed as unmanaged in configuration or by udev rules are silently ignored;
nmcli device statusshows this. - Applying a new static address over SSH can drop the session; use
nmcli connection upin one command or a console. - Duplicate profiles with autoconnect on the same device lead to unpredictable selection after reboot.
The simple explanation
NetworkManager is the part of Linux that gets a computer online and keeps it online. It remembers every network the computer has used, with its passwords and settings, and switches between them automatically.
When a laptop is unplugged from the office cable and opened at home, NetworkManager notices the change, picks the saved home Wi-Fi and connects without any typing. The key idea is that the user saves a network once and NetworkManager handles it from then on.
How it is used in practice
An administrator sets up a RHEL 9 database server with two network ports that must survive a switch failure. Using nmcli, the administrator creates a bond profile in active-backup mode with miimon=100, adds eno1 and eno2 as port profiles, and assigns the bond the static address 192.168.20.15/24 with a gateway and two internal DNS servers.
A second profile adds VLAN 30 on top of the bond for backup traffic. All profiles are stored as keyfiles, so the configuration persists across reboots and can be copied to the second database node with only the address changed. During a planned switch upgrade, one cable is pulled, the bond fails over within about 100 milliseconds, and the database connections remain open.