As an operating system renowned for its versatility and customizability, having robust and easy-to-use network management tools is critical for Arch Linux. The NetworkManager framework fulfills that need, providing Arch users control over wired, wireless, VPN, and other connection types via simple command line tools or graphical interfaces.
In this comprehensive 2600+ word guide, we‘ll cover NetworkManager‘s architecture, installation, configuration, development, integration, and usage – mastering wired and wireless network control on Arch Linux.
NetworkManager Architecture: Dynamic Network Control
At its core, NetworkManager is a system daemon that manages the network configurations, connections, and state across various interfaces and connection types. Rather than setting up networking statically in /etc/network/interfaces like traditional Linux distributions, NetworkManager taps into dynamic runtime APIs for more flexibility:
logout -> gdm -> X server
^ ^
| dbus | dbus
| |
nm-applet NetworkManager
^ ^
dbus plugins
(wifi, WWAN, VPN)
As this architecture highlights, NetworkManager provides D-Bus APIs that both end-user applications like nm-applet and connection plugins tap into for monitoring network state and applying configurations. The daemon handles interface management, connecting/reconnecting, VPN tunneling, and more across wired, WiFi, mobile broadband, and other link layers. Such dynamic run-time control and abstraction from link types gives NetworkManager unprecedented flexibility.
NetworkManager also integrates tightly with systemd, relied upon heavily in Arch Linux. The systemd integration handles automatic activation of NetworkManager when network connectivity is requested. It also manages logging, tracking link states, starting/stopping devices, and issuing notifications. Tight systemd integration lends well to the Arch philosophy.
Plugin extensions are also a key architectural component. The plugin model allows support for multiple connection and link types using a modular abstraction layer. Standard plugins ship with NetworkManager to handle WiFi, WWAN, PPPoE, OpenVPN, and more. However, developers can build custom plugins through the plugin D-Bus API for new hardware or connection types.
In summary, NetworkManager‘s modular architecture, systemd integration, and plugin model together enable robust, flexible network management per the Arch Linux ethos. For those seeking control down to the last IP address octet or support for that shiny new WiFi driver, NetworkManager delivers.
Installing NetworkManager & Components
With an understanding of how NetworkManager functions under the hood, let‘s shift focus to getting it running on an Arch system. Installing NetworkManager first requires grabbing some wireless and connection packages:
$ sudo pacman -S wpa_supplicant wireless_tools pppoe dnsmasq networkmanager
- wpa_supplicant – Connects/authenticates to wireless networks
- wireless_tools – Low level utils for configuring wireless adapters
- dnsmasq – Lightweight DNS/DHCP server, run by NetworkManager
- pppoe – For PPPoE DSL connections
- networkmanager – The actual NetworkManager package
With those packages installed, enabling and starting NetworkManager brings it fully online:
$ sudo systemctl enable NetworkManager.service
$ sudo systemctl start NetworkManager.service
If you have any other network daemons running such as dhcpcd, disabling those will hand complete control over to NetworkManager:
$ sudo systemctl disable dhcpcd
$ sudo systemctl disable netctl
Now NetworkManager will initialize any network interfaces detected and have full system privileges to manage connections.
Connecting Networks with nmcli
With NetworkManager up and running, the nmcli tool offers a simple command line interface to utilize its connection management capabilities. To scan for nearby WiFi networks visible to your adapter, invoke:
$ nmcli device wifi list
Sample Output:
IN-USE SSID MODE CHAN RATE SIGNAL BARS SECURITY
* NETGEAR113 Infra 6 54 Mbit/s 90 ▂▄▆█ WPA1 WPA2
CoffeeShop Infra 11 54 Mbit/s 78 ▂▄▆_ WPA2
LANParty Infra 3 54 Mbit/s 67 ▂▄__ WEP
The ‘*‘ indicates our currently connected WiFi network. With scan results in hand, connect to a target network by specifying its SSID and password:
$ sudo nmcli device wifi connect CoffeeShop password "$uper$3cretPa$$word"
Once connected, run nmcli connection show to confirm the new connection‘s activation status and interface assignment.
For wired Ethernet connections, NetworkManager auto-connects available links using DHCP by default. However, static IPs or customized options are configurable as well:
$ nmcli connection edit Wired\ connection\ 1
The nmtui utility offers similar connectivity management through an interactive curses interface – ideal for headless Arch servers:
$ nmtui
Advanced nmcli Usage
Beyond simply connecting networks, nmcli manages nearly all facets of NetworkManager:
- Show verbose connection details:
nmcli connection show eth0 - Refresh connection state:
nmcli networking connectivity recheck - Restart dead connections:
nmcli connection up eth0 - Modify/delete existing connections:
nmcli con edit eth0 - Log verbose debug output:
nmcli general logging level DEBUG
As highlighted by these examples, nmcli gives full control over NetworkManager right from the command line – critical for headless Arch boxes.
Creating Custom Connection Profiles
NetworkManager‘s default behavior works for simple network environments – connect Eth0 to DHCP and join visible WiFi networks. However, for complex network topographies spanning static IPs, customized WiFi settings, VLAN tagged devices, and multiple simultaneous links across varied transport types, custom connection profiles add specificity.
Connection profiles encode details like:
- Connection name
- Interface type (Ethernet, WiFi, WWAN, etc)
- IPv4/IPv6 configuration (DHCP, static IP/netmask)
- 802.11 WiFi settings (SSID, security mode)
- VLAN interface tagging
- And much more
Such metadata encapsulates specialized parameters for a given network while allowing that environment to be dynamically connected just by referencing its profile name.
For example, an Ethernet profile for a private corporate LAN with static IPs could be defined as:
$ nmcli connection add con-name "CorpLAN" ifname eth0 type Ethernet \
ipv4.address "192.168.1.25/24 192.168.1.1"
$ nmcli connection up CorpLAN
This incorporates the static IP, netmask, and gateway while associating that configuration with the symbolic name "CorpLAN". Activating our new profile instantly connects Eth0 to those parameters.
WiFi connections can encode details like SSID, security modes, MAC address filtering, and more:
nmcli con add con-name GuestWiFi ifname wlp2s0 type wifi ssid GuestWiFi \
wifi-sec.key-mgmt wpa-psk wifi-sec.pskSuperPassword3000
With such tailored connectivity environments defined up front, activating them is as simple as:
$ nmcli con up GuestWiFi
No manual iwconfig, ifconfig, or wpa_supplicant invocations needed!
Sample Connection Profile Configs
For quick reference, here are some sample NetworkManager connection profile snippets for popular network types:
/etc/NetworkManager/system-connections/Wired_static_IP
[connection]
id=Wired_static_IP
uuid=8c140878-3a35-4a2d-85a4-017af1d62b59
type=ethernet
[ipv4]
method=manual
adress=10.10.10.75/24
dns=10.10.10.1;
[ipv6]
method=ignore
Defines static IPv4 configuration for Ethernet.
/etc/NetworkManager/system-connections/office_wifi
[connection]
id=office_wifi
uuid=9e233d38-6c96-4ab7-b924-ab9273a6c5b6
type=wifi
[wifi]
ssid=Linvo_5G
[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=My_wPA_k3y00
Secure WiFi profile with WPA2 PSK key.
/etc/NetworkManager/system-connections/Corp_OpenVPN
[connection]
id=Corp_OpenVPN
uuid=47a473ca-d202-4fb3-a9e1-a7e3a8d3c994
type=vpn
[vpn]
service-type=org.freedesktop.NetworkManager.openvpn
connection-type=password-tls
[vpn-secrets]
password=CorpPassW0rd2022!
Sets up OpenVPN client connectivity.
With the power to encode specialized network parameters for static IP LANs, WiFi, VPNs, and niche links into reusable profiles, NetworkManager simplifies connecting to complex topographies on Arch Linux.
Building & Extending NetworkManager
As an open source project actively developed on GitHub, staying on the bleeding edge of NetworkManager requires building updates manually. Similarly, taking full advantage of NetworkManager‘s plugin architecture necessitates coding custom extensions. Let‘s explore both.
Compiling Latest Code
To compile NetworkManager from source, start by installing requisite development dependencies:
$ sudo pacman -S git gcc make pkg-config gobject-introspection dbus-glib systemd \
libnm-util
With build tools in place, clone the NetworkManager repo from GitHub and checkout the latest commit:
$ git clone https://github.com/NetworkManager/NetworkManager.git
$ cd NetworkManager
$ git checkout 54861705d2f31f50732d322188904598d342a34f
Finally invoke configure, make, and make install to compile and activate the updated NetworkManager build:
$./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib
$ make -j8
$ sudo make install
Remember to restart the NetworkManager service to initialize the new version. Rebuilding NetworkManager yourself gives access to the latest bug fixes and features.
Authorizing Custom Plugins
NetworkManager‘s plugin model supports extensions for new hardware and connection types like ZigBee, InfiniBand, or proprietary WiFi drivers. Implementing such functionality boils down to adhering to the standard plugin D-Bus API.
As an example, let‘s build and integrate support for a fictional FooWifi secure wireless technology:
- Specify plugin dependency details in a foowifi.service file:
[D-BUS Service]
Name=org.freedesktop.NetworkManager.foowifi
Exec=/usr/lib/nm-foowifi-service
SystemdService=nm-foowifi-service.service
- Next author a systemd unit file nm-foowifi-service.service launching our module:
[Unit]
Description=NetworkManager FooWiFi Plugin
[Service]
Type=dbus
BusName=org.freedesktop.NetworkManager.foowifi
ExecStart=/usr/lib/nm-foowifi-service
-
Actually implement the D-Bus service in nm-foowifi-service and install under /usr/lib
-
Finally, authorize the new plugin by adding this line under [main] in NetworkManager.conf:
[main]
plugins=ifupdown,keyfile,ofono,FooWifi
Ensure FooWifi matches the plugin‘s file name defined in the .service file.
Through manual compilation and custom plugins, NetworkManager is highly extensible to Arch Linux aficionados.
Integrating with Desktops & Distros
While extremely capable as a standalone utility accessed via nmcli / nmtui, NetworkManager also integrates with desktop environments like GNOME for simplified graphical management.
The NetworkManager GNOME applet (nm-applet) lives in the system tray, providing users a dropdown of discovered networks alongside connectivity status. Simple and minimal graphical management compliments nmcli nicely.
NetworkManager‘s distribution flexibility extends beyond Arch and GNOME as well. Integration across other major distros like RHEL, CentOS, Ubuntu, OpenSUSE, Fedora, Debian, and Gentoo help cement its status as the gold standard for Linux network control.
Comparatively speaking, NetworkManager offers Desktop Environments more seamless integration over old-school methods like ifupdown scripts. The dynamic run-time nature gels better with mobile-first initiatives as well. For these reasons, heavyweight enterprise distros like RHEL adopted NetworkManager years ago while lightweight traditions like Arch Linux implement it optionally.
Ultimately, NetworkManager flexibility stems from its dynamic D-Bus architecture versus ifupdown‘s static configs. Tight integration with systemd solidifies robust connectivity on modern Linux systems. For Arch users, nmcli + nmtui offer easy CLI connectivity while still providing under-the-hood tweaking capabilities.
Conclusion
For managing Arch Linux‘s network connections gracefully across wired, wireless, VPNs, and cellular links alike – NetworkManager is unmatched. Its systemd integration and plugin architecture yield dynamic run-time control perfect for fluctuating mobile networks.
Nmcli and nmtui bring easy command line connectivity while still exposing advanced configuration capabilities for power users. Integrations across GNOME, RHEL, Ubuntu, and other desktops cements NetworkManager as the industry standard for Linux networking.
Take control over Arch Linux‘s network connectivity with NetworkManager today for robust wired and wireless management. The built-in cli tools and plugins deliver simply connections while allowing customization down to every IP address octet and DNS server. Start mastering Arch network management now with NetworkManager!


