NetworkManager: Difference between revisions

From Alpine Linux
(note that NetworkManager's support for iwd is buggy (for the record, in my experience it definitely is; iwd standalone works great and so does NM/wpa_supplicant), with a link to the NetworkManager gitlab issues page on iwd as the backend)
Line 81: Line 81:
==== iwd backend ====
==== iwd backend ====


NetworkManager supports wireless networks through {{Pkg|iwd}}. After installation, enable the server and restart NetworkManager:
NetworkManager supports wireless networks through {{Pkg|iwd}}, however, consider [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues?scope=all&utf8=%E2%9C%93&state=opened&search=iwd existing issues] before using it. After installation, enable the server and restart NetworkManager:
<pre>
<pre>
rc-service iwd start
rc-service iwd start

Revision as of 18:58, 9 June 2022

NetworkManager is a program that provides automatic detection and configuration for systems to connect to networks.

Installation

# apk add networkmanager


NetworkManager comes with a command line interface and a curses-based interface, nmcli and nmtui respectively or you can use a additional gui interface:


After installation start NetworkManager:

# rc-service networkmanager start


Also your user needs to be in the plugdev group:

# adduser <YourUsername> plugdev

Note: you will need to log out for the new group to take effect


Wireless networks

wpa_supplicant backend

Todo: (KDE Plasma Desktop) find out if it is possible to prevent requesting the password for KDE Wallet on login


Note: wpa_supplicant configuration might not be required, if it isnt it may be a good idea to have it setup just as a fallback


Now open /etc/NetworkManager/NetworkManager.conf in a text editor and change it to something like this:

Contents of /etc/NetworkManager/NetworkManager.conf

[main] dhcp=internal plugins=ifupdown,keyfile [ifupdown] managed=true [device] wifi.scan-rand-mac-address=yes wifi.backend=wpa_supplicant
Note: if these options dont work on your system you can change them as necessary


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 mentioned in Installation


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 through iwd, however, consider existing issues before using it. After installation, enable the server and restart NetworkManager:

rc-service iwd start
rc-service networkmanager restart

To use iwd though, you've have to edit NetworkManager's configuration because it still defaults to wpa_supplicant instead. Add the following to /etc/NetworkManager/NetworkManager.conf:

[device]
wifi.backend=iwd


VPN support

Since version 1.16, NetworkManager has support for Wireguard[1].

Support for other VPN types is provided by plugins. They are provided in the following packages: