NetworkManager

On this page 7

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.

ConceptMeaningExample
DeviceA kernel network interfaceenp3s0, wlp2s0, wg0
Connection profileSaved settings for one networkoffice-wired, home-wifi
Active connectionA profile currently applied to a devicehome-wifi on wlp2s0
AutoconnectAutomatic activation when possibleautoconnect yes, priority 10
Dispatcher scriptHook run on state changesMount a share when the VPN comes up
Core NetworkManager concepts

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.

TypeTypical useNotes
EthernetWired desktops and serversStatic or DHCP, 802.1X possible
Wi-FiLaptops and mobile devicesWPA2, WPA3, enterprise EAP, hotspot mode
Bond, bridge, teamRedundancy and virtualization hostsDefined as master and port profiles
VLANTagged network segmentsParent device plus VLAN ID 1-4094
VPNRemote accessWireGuard built in, OpenVPN and others via plugins
Mobile broadbandLTE and 5G modemsWorks together with ModemManager
Supported connection types

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.

CommandPurpose
nmcli device statusShow devices and their state
nmcli connection showList saved profiles
nmcli connection add type ethernet ifname enp3s0Create a new wired profile
nmcli connection modify office ipv4.addresses 10.0.0.5/24Change a profile setting
nmcli connection up officeActivate a profile
nmcli device wifi connect SSID –askJoin a Wi-Fi network interactively
nmcli general logging level DEBUGRaise log detail for troubleshooting
Common nmcli commands

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.

ToolRolePersistenceTypical environment
NetworkManagerDaemon applying profilesProfiles survive rebootsDesktops, laptops, RHEL servers
ip commandDirect kernel configurationLost at rebootDiagnostics and quick changes
NetplanYAML generator for a back endRenders to NetworkManager or networkdUbuntu
systemd-networkdLightweight network daemonDeclarative .network filesServers, containers, appliances
nftables, iptables, UFWPacket filteringSeparate rule setsFirewalls, not addressing
NetworkManager and neighboring tools

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.conf by 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 status shows this.
  • Applying a new static address over SSH can drop the session; use nmcli connection up in 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.