NetworkManager-1.14.6

Introduction to 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.

This package is known to build and work properly using an LFS-8.4 platform.

Package Information

NetworkManager Dependencies

Required

dbus-glib-0.110 and libndp-1.7

Recommended

Optional

BlueZ-5.50, D-Bus Python-1.2.8 (for the test suite), GnuTLS-3.6.6 (used if NSS-3.42.1 is not found), GTK-Doc-1.29, jansson-2.12, libpsl-0.20.2, Qt-5.12.1 (for examples), ModemManager-1.10.0, Valgrind-3.14.0, dnsmasq, libaudit, libteam, PPP, and RP-PPPoE

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/NetworkManager

Installation of NetworkManager

If Qt-5.12.1 is installed and the Qt based examples are desired, fix the configure script:

sed -e '/Qt[CDN]/s/Qt/Qt5/g'       \
    -e 's/-qt4/-qt5/'              \
    -e 's/moc_location/host_bins/' \
    -i examples/C/qt/meson.build

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

sed '/initrd/d' -i src/meson.build

Fix the python scripts so that they use Python 3:

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

Install NetworkManager by running the following commands:

mkdir build &&
cd build    &&

CXXFLAGS+="-O2 -fPIC"            \
meson --prefix /usr              \
      --sysconfdir /etc          \
      --localstatedir /var       \
      -Djson_validation=false    \
      -Dlibaudit=no              \
      -Dlibnm_glib=true          \
      -Dlibpsl=false             \
      -Dnmtui=true               \
      -Dovs=false                \
      -Dppp=false                \
      -Dselinux=false            \
      -Dudev_dir=/lib/udev       \
      -Dsession_tracking=no      \
      -Dmodem_manager=false      \
      -Dsystemdsystemunitdir=no  \
      -Dsystemd_journal=false    \
      -Dqt=false                 \
      .. &&
ninja

An already active graphical session with bus address is necessary to run the tests. To test the results, issue: ninja test.

Now, as the root user:

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

Command Explanations

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.29 is installed.

-Dnmtui=true: This parameter enables building nmtui.

-Dsession_tracking=no, -Dsystemdsystemunitdir=no, and -Dsystemd_journal=false: systemd is not used for sysv init systems.

-Djson_validation=false, -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.

-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.

Configuring NetworkManager

Config Files

/etc/NetworkManager/NetworkManager.conf

Configuration Information

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

cat >> /etc/NetworkManager/NetworkManager.conf << "EOF"
[main]
plugins=keyfile
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 direcotry.

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

cat > /etc/NetworkManager/conf.d/polkit.conf << "EOF"
[main]
auth-polkit=true
EOF

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

cat > /etc/NetworkManager/conf.d/dhcp.conf << "EOF"
[main]
dhcp=dhclient
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"
[main]
dns=none
EOF

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

To allow regular users permission 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 (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("netdev")) {
        return polkit.Result.YES;
    }
});
EOF

Boot Script

To automatically start the NetworkManager daemon when the system is rebooted, install the /etc/rc.d/init.d/networkmanagerbootscript from the blfs-bootscripts-20180105 package.

[Note]

Note

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.

make install-networkmanager

Contents

Installed Programs: NetworkManager, nmcli, nm-online, nmtui, and, symlinked to nmtui: nmtui-connect, nmtui-edit, and nmtui-hostname
Installed Libraries: libnm.so and several modules under /usr/lib/NetworkManager
Installed Directories: /etc/NetworkManager, /usr/include/libnm, /usr/lib/NetworkManager, /usr/share/doc/NetworkManager-1.14.6, /usr/share/gtk-doc/html/{libnm,NetworkManager} (if the documentation is built), and /var/lib/NetworkManager

Short Descriptions

nmcli

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

nm-online

is a utility to find out whether you are online.

nmtui

is an interactive ncurses based interface for nmcli.

nmtui-connect

is an interactive ncurses based interface connection to activate/deactivate connections.

nmtui-edit

is an interactive ncurses based interface connection editor.

nmtui-hostname

is an interactive ncurses based interface hostname editor.

NetworkManager

is the network management daemon.

libnm.so

contains functions used by NetworkManager.

Last updated on 2019-02-26 09:56:18 -0800