source: networking/netutils/networkmanager.xml@ 7fd06b0

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.4 9.0 9.1 bdubbs/svn kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 7fd06b0 was 7fd06b0, checked in by DJ Lucas <dj@…>, 5 years ago

Clarify modular configuration of NetworkManager with examples of common and recommended configurations.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@20822 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 18.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY NetworkManager-download-http
8 "&gnome-download-http;/NetworkManager/1.14/NetworkManager-&NetworkManager-version;.tar.xz">
9 <!ENTITY NetworkManager-download-ftp
10 "&gnome-download-ftp;/NetworkManager/1.14/NetworkManager-&NetworkManager-version;.tar.xz">
11 <!ENTITY NetworkManager-md5sum "54ce62f0aa18ef6c5e754eaac47494ac">
12 <!ENTITY NetworkManager-size "4.2 MB">
13 <!ENTITY NetworkManager-buildsize "721 MB (with tests)">
14 <!ENTITY NetworkManager-time "0.5 SBU (with tests)">
15]>
16
17<sect1 id="NetworkManager" xreflabel="NetworkManager-&NetworkManager-version;">
18 <?dbhtml filename="networkmanager.html"?>
19
20 <sect1info>
21 <othername>$LastChangedBy$</othername>
22 <date>$Date$</date>
23 </sect1info>
24
25 <title>NetworkManager-&NetworkManager-version;</title>
26
27 <indexterm zone="NetworkManager">
28 <primary sortas="a-NetworkManager">NetworkManager</primary>
29 </indexterm>
30
31 <sect2 role="package">
32 <title>Introduction to NetworkManager</title>
33
34 <para>
35 <application>NetworkManager</application> is a set of co-operative
36 tools that make networking simple and straightforward. Whether WiFi,
37 wired, 3G, or Bluetooth, NetworkManager allows you to quickly move from
38 one network to another: Once a network has been configured and joined
39 once, it can be detected and re-joined automatically the next time it's
40 available.
41 </para>
42
43 &lfs83_checked;
44
45 <note revision="systemd">
46 <para>
47 Make sure that you disable the <command>systemd-networkd</command>
48 service or configure it not to manage the interfaces you want to manage
49 with <application>NetworkManager</application>.
50 </para>
51 </note>
52
53 <bridgehead renderas="sect3">Package Information</bridgehead>
54 <itemizedlist spacing="compact">
55 <listitem>
56 <para>
57 Download (HTTP): <ulink url="&NetworkManager-download-http;"/>
58 </para>
59 </listitem>
60 <listitem>
61 <para>
62 Download (FTP): <ulink url="&NetworkManager-download-ftp;"/>
63 </para>
64 </listitem>
65 <listitem>
66 <para>
67 Download MD5 sum: &NetworkManager-md5sum;
68 </para>
69 </listitem>
70 <listitem>
71 <para>
72 Download size: &NetworkManager-size;
73 </para>
74 </listitem>
75 <listitem>
76 <para>
77 Estimated disk space required: &NetworkManager-buildsize;
78 </para>
79 </listitem>
80 <listitem>
81 <para>
82 Estimated build time: &NetworkManager-time;
83 </para>
84 </listitem>
85 </itemizedlist>
86
87 <bridgehead renderas="sect3">NetworkManager Dependencies</bridgehead>
88
89 <bridgehead renderas="sect4">Required</bridgehead>
90 <para role="required">
91 <xref linkend="dbus-glib"/> and
92 <xref linkend="libndp"/>
93 </para>
94
95 <bridgehead renderas="sect4">Recommended</bridgehead>
96 <para role="recommended">
97 <phrase revision="sysv"><xref linkend="consolekit"/>,</phrase>
98 <xref linkend="curl"/>,
99 <xref linkend="dhcpcd"/> or
100 <xref linkend="dhcp"/> (client only),
101 <xref linkend="gobject-introspection"/>,
102 <xref linkend="iptables"/>,
103 <xref linkend="newt"/> (for <command>nmtui</command>),
104 <xref linkend="nss"/>,
105 <xref linkend="polkit"/>,
106 <xref linkend="pygobject3"/>,
107 <phrase revision="systemd"><xref linkend="systemd"/>,</phrase>
108 <xref linkend="upower"/>,
109 <xref linkend="vala"/>, and
110 <xref linkend="wpa_supplicant"/> (built with D-Bus support),
111 </para>
112
113 <bridgehead renderas="sect4">Optional</bridgehead>
114 <para role="optional">
115 <xref linkend="bluez"/>,
116 <xref linkend="dbus-python"/> (for the test suite),
117 <xref linkend="gnutls"/> (used if <xref linkend="nss"/> is not found),
118 <xref linkend="gtk-doc"/>,
119 <xref linkend="jansson"/>,
120 <xref linkend="libpsl"/>,
121 <xref linkend="qt5"/> (for examples),
122 <xref linkend="ModemManager"/>,
123 <xref linkend="valgrind"/>,
124 <ulink url="http://www.thekelleys.org.uk/dnsmasq/doc.html">dnsmasq</ulink>,
125 <ulink url="https://github.com/Distrotech/libaudit">libaudit</ulink>,
126 <ulink url="https://github.com/jpirko/libteam">libteam</ulink>,
127 <ulink url="https://www.samba.org/ftp/ppp/">PPP</ulink>, and
128 <ulink url="https://www.roaringpenguin.com/products/pppoe">RP-PPPoE</ulink>
129 </para>
130
131 <para condition="html" role="usernotes">User Notes:
132 <ulink url="&blfs-wiki;/NetworkManager"/>
133 </para>
134 </sect2>
135
136 <sect2 role="installation">
137 <title>Installation of NetworkManager</title>
138
139 <para>If <xref linkend="qt5"/> is installed and the Qt based
140 examples are desired, fix the configure script:</para>
141
142<screen><userinput>sed -e '/Qt[CDN]/s/Qt/Qt5/g' \
143 -e 's/-qt4/-qt5/' \
144 -e 's/moc_location/host_bins/' \
145 -i examples/C/qt/meson.build</userinput></screen>
146
147 <para>
148 Fix a missing meson.build file for initrd hooks (not used in BLFS):
149 </para>
150
151<screen><userinput>sed '/initrd/d' -i src/meson.build</userinput></screen>
152
153 <para>
154 Install <application>NetworkManager</application> by running the
155 following commands:
156 </para>
157
158<screen revision="sysv"><userinput>mkdir build &amp;&amp;
159cd build &amp;&amp;
160
161CXXFLAGS+="-O2 -fPIC" \
162meson --prefix /usr \
163 --sysconfdir /etc \
164 --localstatedir /var \
165 -Ddocs=true \
166 -Dnmtui=true \
167 -Dppp=false \
168 -Dlibaudit=no \
169 -Dlibnm_glib=true \
170 -Dselinux=false \
171 -Dudev_dir=/lib/udev \
172 -Dsession_tracking=no \
173 -Dsystemdsystemunitdir=no \
174 -Dsystemd_journal=false \
175 -Dqt=false \
176 .. &amp;&amp;
177ninja</userinput></screen>
178
179<screen revision="systemd"><userinput>mkdir build &amp;&amp;
180cd build &amp;&amp;
181
182CXXFLAGS+="-O2 -fPIC" \
183meson --prefix /usr \
184 --sysconfdir /etc \
185 --localstatedir /var \
186 -Ddocs=true \
187 -Dnmtui=true \
188 -Dppp=false \
189 -Dlibaudit=no \
190 -Dlibnm_glib=true \
191 -Dselinux=false \
192 -Dqt=false \
193 -Dudev_dir=/lib/udev \
194 -Dsession_tracking=systemd \
195 -Dsystemdsystemunitdir=/lib/systemd/system \
196 .. &amp;&amp;
197ninja</userinput></screen>
198
199 <para>
200 An already active <phrase revision="sysv">graphical</phrase> session
201 with bus address is necessary to run the tests. To test the results,
202 issue: <command>ninja test</command>.
203 </para>
204
205 <para>
206 Now, as the <systemitem class="username">root</systemitem> user:
207 </para>
208
209<screen role="root"><userinput>ninja install &amp;&amp;
210mv -v /usr/share/doc/NetworkManager{,-&NetworkManager-version;}</userinput></screen>
211
212 </sect2>
213
214 <sect2 role="commands">
215 <title>Command Explanations</title>
216
217 <para>
218 <envar>CXXFLAGS="-O2 -fPIC"</envar>: These compiler options are
219 necessary to build the Qt5 based examples.
220 </para>
221
222 <para>
223 <parameter>-Ddocs=true</parameter>: This parameter enable building of
224 man pages and documentation.
225 </para>
226
227 <para>
228 <parameter>-Dnmtui=true</parameter>: This parameter enables building
229 <command>nmtui</command>.
230 </para>
231
232 <para revision="sysv">
233 <parameter>-Dsession_tracking=no</parameter>,
234 <parameter>-Dsystemdsystemunitdir=no</parameter>, and
235 <parameter>-Dsystemd_journal=false</parameter>: systemd is not
236 used for sysv init systems.
237 </para>
238
239 <para revision="systemd">
240 <parameter>-Dsession_tracking=systemd</parameter>: This switch
241 is used to set <command>systemd-logind</command> as the default
242 program for session tracking.
243 </para>
244
245 <para revision="systemd">
246 <parameter>-Dsystemdsystemunitdir=/lib/systemd/system</parameter>:
247 This switch is used to set the correct installation directory for
248 systemd units.
249 </para>
250
251 <para>
252 <parameter>-Dppp=false</parameter>: This parameter disables
253 <application>PPP</application> support in
254 <application>NetworkManager</application>.
255 </para>
256
257 <para>
258 <parameter>-Dlibaudit=no</parameter> and
259 <parameter>-Dselinux=false</parameter>: libaudit and SELinux are not used
260 in BLFS.
261 </para>
262
263 <para>
264 <parameter>-Dqt=false</parameter>: disables the
265 <application>QT</application> examples. Omit if you have
266 <application>QT</application> available and wish to install the examples.
267 </para>
268
269 </sect2>
270
271 <sect2 role="configuration">
272 <title>Configuring NetworkManager</title>
273
274 <sect3 id="NetworkManager-config">
275 <title>Config Files</title>
276 <para>
277 <filename>/etc/NetworkManager/NetworkManager.conf</filename>
278 </para>
279
280 <indexterm zone="NetworkManager NetworkManager-config">
281 <primary
282 sortas="e-etc-NetworkManager-NetworkManager.conf">
283 /etc/NetworkManager/NetworkManager.conf</primary>
284 </indexterm>
285
286 </sect3>
287
288 <sect3><title>Configuration Information</title>
289
290 <para>
291 For <application>NetworkManager</application> to work, at least
292 a minimal configuration file must be present. Such file is not
293 installed with <command>make install</command>. Issue the following
294 command as the <systemitem class="username">root</systemitem> user to
295 create minimal <filename>NetworkManager.conf</filename> file:
296 </para>
297
298<screen role="root"><userinput>cat &gt;&gt; /etc/NetworkManager/NetworkManager.conf &lt;&lt; "EOF"
299<literal>[main]
300plugins=keyfile</literal>
301EOF</userinput></screen>
302
303 <para>
304 This file should not be modified directly by users of the system.
305 Instead, system specific changes should be made using configuration
306 files in the
307 <filename class="directory">/etc/NetworkManager/conf.d</filename>
308 direcotry.
309 </para>
310
311 <para>
312 To allow polkit to manage authorizations, add the following
313 configuration file:
314 </para>
315
316<screen role="root"><userinput>cat &gt; /etc/NetworkManager/conf.d/polkit.conf &lt;&lt; "EOF"
317<literal>[main]
318auth-polkit=true</literal>
319EOF</userinput></screen>
320
321 <para>
322 To use something other than the built-in dhcp client (recommended if
323 using only <command>nmcli</command>), use the following configuration
324 (valid values are dhclient, dhcpcd, and internal):
325 </para>
326
327<screen role="nodump"><userinput>cat &gt; /etc/NetworkManager/conf.d/dhcp.conf &lt;&lt; "EOF"
328<literal>[main]
329dhcp=</literal><replaceable>dhclient</replaceable>
330EOF</userinput></screen>
331
332 <para>
333 To prevent <application>NetworkManager</application> from updating the
334 <filename>/etc/resolv.conf</filename> file, add the following
335 configuration file:
336 </para>
337
338<screen role="nodump"><userinput>cat &gt; /etc/NetworkManager/conf.d/no-dns-update.conf &lt;&lt; "EOF"
339<literal>[main]
340dns=none</literal>
341EOF</userinput></screen>
342
343 <para>
344 For additional configuation options, see
345 <command>man 5 NetworkManager.conf</command>.
346 </para>
347
348 <para>
349 To allow regular users permission to configure network connections,
350 you should add them to the
351 <systemitem class="groupname">netdev</systemitem>
352 group, and create a <application>polkit</application> rule that grants
353 access. Run the following commands as the
354 <systemitem class="username">root</systemitem> user:
355 </para>
356
357<screen role="root"><userinput>groupadd -fg 86 netdev &amp;&amp;
358/usr/sbin/usermod -a -G netdev <replaceable>&lt;username&gt;</replaceable>
359
360cat &gt; /usr/share/polkit-1/rules.d/org.freedesktop.NetworkManager.rules &lt;&lt; "EOF"
361<literal>polkit.addRule(function(action, subject) {
362 if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 &amp;&amp; subject.isInGroup("netdev")) {
363 return polkit.Result.YES;
364 }
365});</literal>
366EOF</userinput></screen>
367
368 </sect3>
369
370 <sect3 id="NetworkManager-init">
371 <title><phrase revision="sysv">Boot Script</phrase>
372 <phrase revision="systemd">Systemd Unit</phrase></title>
373
374 <para revision="sysv">
375 To automatically start the <command>NetworkManager</command> daemon
376 when the system is rebooted, install the
377 <filename>/etc/rc.d/init.d/networkmanager</filename>bootscript from the
378 <xref linkend="bootscripts"/> package.
379 </para>
380
381 <para revision="systemd">
382 To start the <command>NetworkManager</command> daemon at boot, enable
383 the previously installed systemd unit by running the following command
384 as the <systemitem class="username">root</systemitem> user:
385 </para>
386
387 <note>
388 <para>
389 If using <application>Network Manager</application> to manage
390 an interface, any previous configuration for that interface should be
391 removed, and the interface brought down prior to starting
392 <application>Network Manager</application>.
393 </para>
394 </note>
395
396 <indexterm zone="NetworkManager NetworkManager-init">
397 <primary sortas="f-NetworkManager">NetworkManager</primary>
398 </indexterm>
399
400<screen role="root" revision="sysv"><userinput>make install-networkmanager</userinput></screen>
401
402<screen role="root" revision="systemd"><userinput>systemctl enable NetworkManager</userinput></screen>
403
404 <para revision="systemd">
405 <application>NetworkManager</application> also ships a systemd unit
406 called <filename>NetworkManager-wait-online.service</filename> which
407 can be used to prevent services that require network connectivity
408 from starting until <application>NetworkManager</application> has
409 established the connection. To enable it, run the following command
410 as the <systemitem class="username">root</systemitem> user:
411 </para>
412
413<screen role="root" revision="systemd"><userinput>systemctl enable NetworkManager-wait-online</userinput></screen>
414
415 </sect3>
416
417 </sect2>
418
419 <sect2 role="content">
420 <title>Contents</title>
421
422 <segmentedlist>
423 <segtitle>Installed Programs</segtitle>
424 <segtitle>Installed Libraries</segtitle>
425 <segtitle>Installed Directories</segtitle>
426
427 <seglistitem>
428 <seg>
429 NetworkManager, nmcli, nm-online, nmtui, and, symlinked to nmtui:
430 nmtui-connect, nmtui-edit, and nmtui-hostname
431 </seg>
432 <seg>
433 libnm.so and several modules under /usr/lib/NetworkManager
434 </seg>
435 <seg>
436 /etc/NetworkManager,
437 /usr/include/libnm,
438 /usr/lib/NetworkManager,
439 /usr/share/doc/NetworkManager-&NetworkManager-version;,
440 /usr/share/gtk-doc/html/{libnm,NetworkManager}
441 (if the documentation is built),
442 and
443 /var/lib/NetworkManager
444 </seg>
445 <!-- A lot of libraries were removed here. We should verify compatibilty. -->
446 </seglistitem>
447 </segmentedlist>
448
449 <variablelist>
450 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
451 <?dbfo list-presentation="list"?>
452 <?dbhtml list-presentation="table"?>
453
454 <varlistentry id="nmcli">
455 <term><command>nmcli</command></term>
456 <listitem>
457 <para>
458 is a command-line tool for controlling
459 <application>NetworkManager</application>
460 and getting its status.
461 </para>
462 <indexterm zone="NetworkManager nmcli">
463 <primary sortas="b-nmcli">nmcli</primary>
464 </indexterm>
465 </listitem>
466 </varlistentry>
467
468 <varlistentry id="nm-online">
469 <term><command>nm-online</command></term>
470 <listitem>
471 <para>
472 is a utility to find out whether you are online.
473 </para>
474 <indexterm zone="NetworkManager nm-online">
475 <primary sortas="b-nm-online">nm-online</primary>
476 </indexterm>
477 </listitem>
478 </varlistentry>
479
480 <varlistentry id="nmtui">
481 <term><command>nmtui</command></term>
482 <listitem>
483 <para>
484 is an interactive ncurses based interface for
485 <application>nmcli</application>.
486 </para>
487 <indexterm zone="NetworkManager nmtui">
488 <primary sortas="b-nmtui">nmtui</primary>
489 </indexterm>
490 </listitem>
491 </varlistentry>
492
493 <varlistentry id="nmtui-connect">
494 <term><command>nmtui-connect</command></term>
495 <listitem>
496 <para>
497 is an interactive ncurses based interface connection to
498 activate/deactivate connections.
499 </para>
500 <indexterm zone="NetworkManager nmtui-connect">
501 <primary sortas="b-nmtui-connect">nmtui-connect</primary>
502 </indexterm>
503 </listitem>
504 </varlistentry>
505
506 <varlistentry id="nmtui-edit">
507 <term><command>nmtui-edit</command></term>
508 <listitem>
509 <para>
510 is an interactive ncurses based interface connection editor.
511 </para>
512 <indexterm zone="NetworkManager nmtui-edit">
513 <primary sortas="b-nmtui-edit">nmtui-edit</primary>
514 </indexterm>
515 </listitem>
516 </varlistentry>
517
518 <varlistentry id="nmtui-hostname">
519 <term><command>nmtui-hostname</command></term>
520 <listitem>
521 <para>
522 is an interactive ncurses based interface hostname editor.
523 </para>
524 <indexterm zone="NetworkManager nmtui-hostname">
525 <primary sortas="b-nmtui-hostname">nmtui-hostname</primary>
526 </indexterm>
527 </listitem>
528 </varlistentry>
529
530 <varlistentry id="NetworkManager-prog">
531 <term><command>NetworkManager</command></term>
532 <listitem>
533 <para>
534 is the network management daemon.
535 </para>
536 <indexterm zone="NetworkManager NetworkManager-prog">
537 <primary sortas="b-NetworkManager">NetworkManager</primary>
538 </indexterm>
539 </listitem>
540 </varlistentry>
541
542 <varlistentry id="libnm">
543 <term><filename class="libraryfile">libnm.so</filename></term>
544 <listitem>
545 <para>
546 contains functions used by <application>NetworkManager</application>.
547 </para>
548 <indexterm zone="NetworkManager libnm">
549 <primary sortas="c-libnm">libnm.so</primary>
550 </indexterm>
551 </listitem>
552 </varlistentry>
553
554 </variablelist>
555
556 </sect2>
557
558</sect1>
Note: See TracBrowser for help on using the repository browser.