NetworkManager: Difference between revisions
No edit summary |
Prabuanand (talk | contribs) (moved content to make it easier to follow) |
||
Line 1: | Line 1: | ||
[https://networkmanager.dev/ NetworkManager] is the standard Linux network configuration tool suite. | [https://networkmanager.dev/ NetworkManager] is the standard Linux network configuration tool suite. | ||
== Installation == | == Installation == | ||
Line 5: | Line 5: | ||
Networkmanager needs to have [[eudev|udev]] to be setup properly. Otherwise your network devices can be listed as (strictly-)unmanaged. | Networkmanager needs to have [[eudev|udev]] to be setup properly. Otherwise your network devices can be listed as (strictly-)unmanaged. | ||
{{:Include:Setup Device Manager}} | {{:Include:Setup Device Manager}} | ||
To be able to use NetworkManager with your current user (i.e. not root), you need to add your user to the <code>plugdev</code> group: {{Cmd|# adduser <YourUsername> plugdev}} | To be able to use NetworkManager with your current user (i.e. not root), you need to add your user to the <code>plugdev</code> group: {{Cmd|# adduser <YourUsername> plugdev}} | ||
{{Note|you will need to log out for the new group to take effect}} | {{Note|you will need to log out for the new group to take effect}} | ||
Install the basic Network Management daemon of NetworkManager suite:{{Cmd|# apk add {{Pkg|networkmanager}}}} | |||
For the list of all NetworkManager subpackages refer {{pkg|networkmanager-*}}. Choose the appropriate subpackage based on the required functionalities. The following user interfaces or front ends are available in NetworkManager suite: | |||
* TUI: {{Pkg|networkmanager-tui}}, a curses-based interface (run <code>nmtui</code>) | * TUI: {{Pkg|networkmanager-tui}}, a curses-based interface (run <code>nmtui</code>) | ||
* Command line: {{Pkg|networkmanager-cli}} (run <code>nmcli</code>) | * Command line: {{Pkg|networkmanager-cli}} (run <code>nmcli</code>) | ||
Line 95: | Line 95: | ||
You can enable all users to edit connections without adding polkit. | You can enable all users to edit connections without adding polkit. | ||
First, make the <code>conf.d</code> directory for networkmanager: | First, make the <code>conf.d</code> directory for networkmanager: {{Cmd|# mkdir -p /etc/NetworkManager/conf.d}} | ||
{{Cmd|# mkdir -p /etc/NetworkManager/conf.d}} | |||
Then, add following content to {{path|/etc/NetworkManager/conf.d/any-user.conf}} so that {{cat|/etc/NetworkManager/conf.d/any-user.conf|[main] | Then, add following content to {{path|/etc/NetworkManager/conf.d/any-user.conf}} so that {{cat|/etc/NetworkManager/conf.d/any-user.conf|[main] |
Revision as of 16:45, 2 March 2025
NetworkManager is the standard Linux network configuration tool suite.
Installation
Networkmanager needs to have udev to be setup properly. Otherwise your network devices can be listed as (strictly-)unmanaged. Setting up eudev as device manager on desktop systems is recommended in Alpine Linux. Without a fully functional device manager, users will not be able to connect to input devices. The alpine-conf package provides setup-devd script to easily install and setup device managers.
To set up eudev, issue the command:
# setup-devd udev
To be able to use NetworkManager with your current user (i.e. not root), you need to add your user to the plugdev
group:
# adduser <YourUsername> plugdev
Install the basic Network Management daemon of NetworkManager suite:
# apk add networkmanager
For the list of all NetworkManager subpackages refer networkmanager-*. Choose the appropriate subpackage based on the required functionalities. The following user interfaces or front ends are available in NetworkManager suite:
- TUI: networkmanager-tui, a curses-based interface (run
nmtui
) - Command line: networkmanager-cli (run
nmcli
) - GUI: plasma-nm for Plasma integration and applet
- GUI: network-manager-applet for a GTK system tray applet
Networkmanager service
Ensure that network interfaces are configured and tested.
Start NetworkManager:
# rc-service networkmanager start
Set the service to autostart on boot:
# rc-update add networkmanager default
Wired networks
If wired networks do not appear or you get an error message like "Could not activate connection: Connection 'Ethernet connection 1' is not available on device eth0 because device is strictly unmanaged", add the following to /etc/NetworkManager/NetworkManager.conf:
Contents of /etc/NetworkManager/NetworkManager.conf
Wireless networks
Install networkmanager-wifi package if you want NetworkManager to connect and manage wifi:
# apk add networkmanager-wifi
NetworkManager supports both wireless daemons i.e iwd and wpa_supplicant. Using both may lead to conflicts.
wpa_supplicant backend
wpa supplicant is the default in Alpine Linux and can be configured to start on system boot.
Now open /etc/NetworkManager/NetworkManager.conf in a text editor and change it to something like this:
Contents of /etc/NetworkManager/NetworkManager.conf
Now you need to stop conflicting services:
# rc-service networking stop
# rc-service wpa_supplicant stop
Now restart NetworkManager:
# rc-service networkmanager restart
Now connect to a network using one of the interfaces configured. If that connects and stays connected with no issues enable the networkmanager
service and disable the networking
and wpa_supplicant
boot services:
# rc-update add networkmanager
# rc-update del networking boot
# rc-update del wpa_supplicant boot
iwd backend
NetworkManager supports wireless networks with iwd as backend, however, consider existing issues before using it.
Using both wireless daemons i.e wpa_supplicant and iwd simultaneously lead to conflicts. Once iwd has been configured, ensure that wpa_supplicant and related services are stopped before continuing. Start the iwd service and restart NetworkManager:
# rc-service iwd start # rc-service networkmanager restart
To use iwd as backend edit NetworkManager's configuration because it still defaults to wpa_supplicant. Edit the file /etc/NetworkManager/NetworkManager.conf and ensure that [device]
section appears as follows:
Contents of /etc/NetworkManager/NetworkManager.conf
VPN support
NetworkManager has support for Wireguard and support for other VPN's are provided by plugins in the following subpackage:
- networkmanager-openvpn for OpenVPN
Plasma support


Troubleshooting
nm-applet not authorized to control networking
You can enable all users to edit connections without adding polkit.
First, make the conf.d
directory for networkmanager:
# mkdir -p /etc/NetworkManager/conf.d
Then, add following content to /etc/NetworkManager/conf.d/any-user.conf so that
Contents of /etc/NetworkManager/conf.d/any-user.conf
Finally, restart networkmanager:
# rc-service networkmanager restart
See also
- Networking - Main page
- wpa_supplicant - Default wifi daemon
- iwd - An alternate wifi daemon