NetworkManager の概要

NetworkManager is a set of co-operative tools that make networking simple and straightforward. Whether you use WiFi, wired, 3G, or Bluetooth, NetworkManager allows you to quickly move from one network to another: Once a network has been configured and joined once, it can be detected and re-joined automatically the next time it's available.

本パッケージは LFS-10.1 において正しくビルドでき動作することが確認されています。



Make sure that you disable the systemd-networkd service or configure it not to manage the interfaces you want to manage with NetworkManager.


NetworkManager の依存パッケージ


jansson-2.13.1, libndp-1.7



BlueZ-5.56, D-Bus Python-1.2.16 (for the test suite), GnuTLS-3.7.0 (used if NSS-3.62 is not found), GTK-Doc-1.33.2, libpsl-0.21.1, Qt-5.15.2 (for examples), ModemManager-1.16.2, Valgrind-3.16.1, dnsmasq, firewalld, libaudit, libteam, mobile-broadband-provider-info, PPP, RP-PPPoE


Kernel Configuration

If you wish to run the tests, enable the following options in the kernel configuration and recompile the kernel if necessary:

Device Drivers --->
  [*] Network device support         [CONFIG_NETDEVICES] --->
    [*] Bonding driver support       [CONFIG_BONDING]
    [*] Dummy net driver support     [CONFIG_DUMMY]
    [*] Ethernet team driver support [CONFIG_NET_TEAM]

NetworkManager のインストール

If Qt-5.15.2 is installed and the Qt based examples are desired, fix two files:

sed -e 's/-qt4/-qt5/'              \
    -e 's/moc_location/host_bins/' \
    -i examples/C/qt/   &&

sed -e 's/Qt/&5/'                  \

Fix a missing file for initrd hooks (not used in BLFS):

sed '/initrd/d' -i src/core/

Fix the python scripts so that they use Python 3:

grep -rl '^#!.*python$' | xargs sed -i '1s/python/&3/'

以下のコマンドを実行して NetworkManager をビルドします。

mkdir build &&
cd    build    &&

CXXFLAGS+="-O2 -fPIC"            \
meson --prefix /usr              \
      -Dlibaudit=no              \
      -Dlibpsl=false             \
      -Dnmtui=true               \
      -Dovs=false                \
      -Dppp=false                \
      -Dselinux=false            \
      -Dqt=false                 \
      -Dudev_dir=/lib/udev       \
      -Dsession_tracking=systemd \
      -Dmodem_manager=false      \
      -Dsystemdsystemunitdir=/lib/systemd/system \
      .. &&

An already active graphical session with a bus address is necessary to run the tests. To test the results, as the root user, issue: ninja test. Five tests, devices/test-acd, platform/test-tc-linux, platform/test-route-linux, platform/test-link-linux, and platform/test-cleanup-linux, are known to fail.

root ユーザーになって以下を実行します。

ninja install &&
mv -v /usr/share/doc/NetworkManager{,-1.30.0}


CXXFLAGS="-O2 -fPIC": These compiler options are necessary to build the Qt5 based examples.

-Ddocs=true: Use this switch to enable building man pages and documentation if GTK-Doc-1.33.2 is installed.

-Dnmtui=true: This parameter enables building nmtui.

-Dlibpsl=false and -Dovs=false: These switches disable building with the respective libraries. Remove if you have the needed libraries installed.

-Dmodem_manager=false: This switch is requried if ModemManager is not installed. Omit if you have built ModemManager and mobile-broadband-provider-info.

-Dsession_tracking=systemd: This switch is used to set systemd-logind as the default program for session tracking.

-Dsystemdsystemunitdir=/lib/systemd/system: This switch is used to set the correct installation directory for systemd units.

-Dppp=false: This parameter disables PPP support in NetworkManager.

-Dlibaudit=no and -Dselinux=false: libaudit and SELinux are not used in BLFS.

-Dqt=false: disables the QT examples. Omit if you have QT available and wish to install the examples.

NetworkManager の設定




For NetworkManager to work, at least a minimal configuration file must be present. Such a file is not installed with make install. Issue the following command as the root user to create a minimal NetworkManager.conf file:

cat >> /etc/NetworkManager/NetworkManager.conf << "EOF"

This file should not be modified directly by users of the system. Instead, system specific changes should be made using configuration files in the /etc/NetworkManager/conf.d directory.

To allow polkit to manage authorizations, add the following configuration file:

cat > /etc/NetworkManager/conf.d/polkit.conf << "EOF"

To use something other than the built-in dhcp client (recommended if using only nmcli), use the following configuration (valid values include either dhclient or internal):

cat > /etc/NetworkManager/conf.d/dhcp.conf << "EOF"

To prevent NetworkManager from updating the /etc/resolv.conf file, add the following configuration file:

cat > /etc/NetworkManager/conf.d/no-dns-update.conf << "EOF"

For additional configuation options, see man 5 NetworkManager.conf.

To allow regular users to configure network connections, you should add them to the netdev group, and create a polkit rule that grants access. Run the following commands as the root user:

groupadd -fg 86 netdev &&
/usr/sbin/usermod -a -G netdev <username>

cat > /usr/share/polkit-1/rules.d/org.freedesktop.NetworkManager.rules << "EOF"
polkit.addRule(function(action, subject) {
    if ("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("netdev")) {
        return polkit.Result.YES;

Systemd ユニット

To start the NetworkManager daemon at boot, enable the previously installed systemd unit by running the following command as the root user:



If using Network Manager to manage an interface, any previous configuration for that interface should be removed, and the interface brought down prior to starting Network Manager.

systemctl enable NetworkManager

Starting in version 1.11.2 of NetworkManager, a systemd unit named NetworkManager-wait-online.service is enabled, which is used to prevent services that require network connectivity from starting until NetworkManager establishes a connection. To disable this behavior, run the following command as the root user:

systemctl disable NetworkManager-wait-online


インストールプログラム: NetworkManager, nmcli, nm-online, nmtui, and, symlinked to nmtui: nmtui-connect, nmtui-edit, and nmtui-hostname
インストールライブラリ:, /usr/lib/NetworkManager 配下の数種のモジュール
インストールディレクトリ: /etc/NetworkManager, /usr/include/libnm, /usr/lib/NetworkManager, /usr/share/doc/NetworkManager-1.30.0, /usr/share/gtk-doc/html/{libnm,NetworkManager} (if the documentation is built), /var/lib/NetworkManager



is a command-line tool for controlling NetworkManager and getting its status


is an utility to determine whether you are online


is an interactive ncurses-based user interface for nmcli


is an interactive ncurses-based user interface to activate/deactivate connections


is an interactive ncurses-based user interface to edit connections


is an interactive ncurses-based user interface to edit the hostname


is the network management daemon

contains functions used by NetworkManager

最終更新日: 2021-02-24 21:40:21 +0900