source: networking/netutils/networkmanager.xml@ 51dfb3e

10.0 10.1 11.0 9.0 9.1 ken/refactor-virt lazarus qt5new trunk xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 51dfb3e was 51dfb3e, checked in by Bruce Dubbs <bdubbs@…>, 2 years ago

Move BLFS/trunk/BOOK and BLFS/trunk/bootscripts to
BLFS/branches/old-trunk-20190627 and BLFS/branches/old-bootscripts-20190627.

Move BLFS/branches/elogind-book and BLFS/branches/elogind-bootscripts
to trunk.

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

  • Property mode set to 100644
File size: 19.9 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.18/NetworkManager-&NetworkManager-version;.tar.xz">
9 <!ENTITY NetworkManager-download-ftp
10 "&gnome-download-ftp;/NetworkManager/1.18/NetworkManager-&NetworkManager-version;.tar.xz">
11 <!ENTITY NetworkManager-md5sum "5d4dd0d5ac86f0b616880e44420b8eb5">
12 <!ENTITY NetworkManager-size "4.6 MB">
13 <!ENTITY NetworkManager-buildsize "777 MB (with tests)">
14 <!ENTITY NetworkManager-time "0.9 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 you use 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 &lfs84_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 <xref linkend="curl"/>,
98 <xref linkend="dhcpcd"/> or
99 <xref linkend="dhcp"/> (client only),
100 <xref linkend="gobject-introspection"/>,
101 <xref linkend="iptables"/>,
102 <xref linkend="jansson"/>,
103 <xref linkend="newt"/> (for <command>nmtui</command>),
104 <xref linkend="nss"/>,
105 <xref linkend="polkit"/>,
106 <xref linkend="pygobject3"/>,
107 <phrase revision="sysv"><xref linkend="elogind"/>,</phrase>
108 <phrase revision="systemd"><xref linkend="systemd"/>,</phrase>
109 <xref linkend="upower"/>,
110 <xref linkend="vala"/>, and
111 <xref linkend="wpa_supplicant"/> (built with D-Bus support),
112 </para>
113
114 <bridgehead renderas="sect4">Optional</bridgehead>
115 <para role="optional">
116 <xref linkend="bluez"/>,
117 <xref linkend="dbus-python"/> (for the test suite),
118 <xref linkend="gnutls"/> (used if <xref linkend="nss"/> is not found),
119 <xref linkend="gtk-doc"/>,
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://dianne.skoll.ca/projects/rp-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 Fix the python scripts so that they use <application>Python
155 3</application>:
156 </para>
157
158<screen><userinput>grep -rl '^#!.*python$' | xargs sed -i '1s/python/&amp;3/'</userinput></screen>
159
160 <para>
161 Install <application>NetworkManager</application> by running the
162 following commands:
163 </para>
164
165<screen revision="sysv"><userinput>mkdir build &amp;&amp;
166cd build &amp;&amp;
167
168CXXFLAGS+="-O2 -fPIC" \
169meson --prefix /usr \
170 --sysconfdir /etc \
171 --localstatedir /var \
172 -Djson_validation=false \
173 -Dlibaudit=no \
174 -Dlibnm_glib=true \
175 -Dlibpsl=false \
176 -Dnmtui=true \
177 -Dovs=false \
178 -Dppp=false \
179 -Dselinux=false \
180 -Dudev_dir=/lib/udev \
181 -Dsession_tracking=elogind \
182 -Dmodem_manager=false \
183 -Dsystemdsystemunitdir=no \
184 -Dsystemd_journal=false \
185 -Dqt=false \
186 .. &amp;&amp;
187ninja</userinput></screen>
188
189<screen revision="systemd"><userinput>mkdir build &amp;&amp;
190cd build &amp;&amp;
191
192CXXFLAGS+="-O2 -fPIC" \
193meson --prefix /usr \
194 --sysconfdir /etc \
195 --localstatedir /var \
196 -Djson_validation=false \
197 -Dlibaudit=no \
198 -Dlibnm_glib=true \
199 -Dlibpsl=false \
200 -Dnmtui=true \
201 -Dovs=false \
202 -Dppp=false \
203 -Dselinux=false \
204 -Dqt=false \
205 -Dudev_dir=/lib/udev \
206 -Dsession_tracking=systemd \
207 -Dmodem_manager=false \
208 -Dsystemdsystemunitdir=/lib/systemd/system \
209 .. &amp;&amp;
210ninja</userinput></screen>
211
212 <para>
213 An already active <phrase revision="sysv">graphical</phrase> session
214 with bus address is necessary to run the tests. To test the results,
215 issue: <command>ninja test</command>.
216 </para>
217
218 <para>
219 Now, as the <systemitem class="username">root</systemitem> user:
220 </para>
221
222<screen role="root"><userinput>ninja install &amp;&amp;
223mv -v /usr/share/doc/NetworkManager{,-&NetworkManager-version;}</userinput></screen>
224
225 </sect2>
226
227 <sect2 role="commands">
228 <title>Command Explanations</title>
229
230 <para>
231 <envar>CXXFLAGS="-O2 -fPIC"</envar>: These compiler options are
232 necessary to build the Qt5 based examples.
233 </para>
234
235 <para>
236 <option>-Ddocs=true</option>: Use this switch to enable building
237 man pages and documentation if <xref linkend="gtk-doc"/> is installed.
238 </para>
239
240 <para>
241 <parameter>-Dnmtui=true</parameter>: This parameter enables building
242 <command>nmtui</command>.
243 </para>
244
245 <para revision="sysv">
246 <parameter>-Dsystemdsystemunitdir=no</parameter> and
247 <parameter>-Dsystemd_journal=false</parameter>: systemd is not
248 used for sysv init systems.
249 </para>
250
251 <para>
252 <parameter>-Djson_validation=false</parameter>,
253 <parameter>-Dlibpsl=false</parameter>, and
254 <parameter>-Dovs=false</parameter>: These switches disable building with the
255 respective libraries. Remove if you have the needed libraries installed.
256 </para>
257
258 <para>
259 <parameter>-Dlibpsl=false</parameter>: This switch is required if
260 <application>libpsl</application> is not installed. Omit this switch if
261 you have built <application>libpsl</application>.
262 </para>
263
264 <para>
265 <parameter>-Dmodem_manager=false</parameter>: This switch is requried if
266 <application>ModemManager</application> is not installed. Omit if you
267 have built <application>ModemManager</application>.
268 </para>
269
270 <para revision="sysv">
271 <parameter>-Dsession_tracking=elogind</parameter>: This switch
272 is used to set <command>elogind</command> as the default
273 program for session tracking.
274 </para>
275
276 <para revision="systemd">
277 <parameter>-Dsession_tracking=systemd</parameter>: This switch
278 is used to set <command>systemd-logind</command> as the default
279 program for session tracking.
280 </para>
281
282 <para revision="systemd">
283 <parameter>-Dsystemdsystemunitdir=/lib/systemd/system</parameter>:
284 This switch is used to set the correct installation directory for
285 systemd units.
286 </para>
287
288 <para>
289 <parameter>-Dppp=false</parameter>: This parameter disables
290 <application>PPP</application> support in
291 <application>NetworkManager</application>.
292 </para>
293
294 <para>
295 <parameter>-Dlibaudit=no</parameter> and
296 <parameter>-Dselinux=false</parameter>: libaudit and SELinux are not used
297 in BLFS.
298 </para>
299
300 <para>
301 <parameter>-Dqt=false</parameter>: disables the
302 <application>QT</application> examples. Omit if you have
303 <application>QT</application> available and wish to install the examples.
304 </para>
305
306 </sect2>
307
308 <sect2 role="configuration">
309 <title>Configuring NetworkManager</title>
310
311 <sect3 id="NetworkManager-config">
312 <title>Config Files</title>
313 <para>
314 <filename>/etc/NetworkManager/NetworkManager.conf</filename>
315 </para>
316
317 <indexterm zone="NetworkManager NetworkManager-config">
318 <primary
319 sortas="e-etc-NetworkManager-NetworkManager.conf">
320 /etc/NetworkManager/NetworkManager.conf</primary>
321 </indexterm>
322
323 </sect3>
324
325 <sect3><title>Configuration Information</title>
326
327 <para>
328 For <application>NetworkManager</application> to work, at least
329 a minimal configuration file must be present. Such file is not
330 installed with <command>make install</command>. Issue the following
331 command as the <systemitem class="username">root</systemitem> user to
332 create minimal <filename>NetworkManager.conf</filename> file:
333 </para>
334
335<screen role="root"><userinput>cat &gt;&gt; /etc/NetworkManager/NetworkManager.conf &lt;&lt; "EOF"
336<literal>[main]
337plugins=keyfile</literal>
338EOF</userinput></screen>
339
340 <para>
341 This file should not be modified directly by users of the system.
342 Instead, system specific changes should be made using configuration
343 files in the
344 <filename class="directory">/etc/NetworkManager/conf.d</filename>
345 direcotry.
346 </para>
347
348 <para>
349 To allow polkit to manage authorizations, add the following
350 configuration file:
351 </para>
352
353<screen role="root"><userinput>cat &gt; /etc/NetworkManager/conf.d/polkit.conf &lt;&lt; "EOF"
354<literal>[main]
355auth-polkit=true</literal>
356EOF</userinput></screen>
357
358 <para>
359 To use something other than the built-in dhcp client (recommended if
360 using only <command>nmcli</command>), use the following configuration
361 (valid values are dhclient, dhcpcd, and internal):
362 </para>
363
364<screen role="nodump"><userinput>cat &gt; /etc/NetworkManager/conf.d/dhcp.conf &lt;&lt; "EOF"
365<literal>[main]
366dhcp=</literal><replaceable>dhclient</replaceable>
367EOF</userinput></screen>
368
369 <para>
370 To prevent <application>NetworkManager</application> from updating the
371 <filename>/etc/resolv.conf</filename> file, add the following
372 configuration file:
373 </para>
374
375<screen role="nodump"><userinput>cat &gt; /etc/NetworkManager/conf.d/no-dns-update.conf &lt;&lt; "EOF"
376<literal>[main]
377dns=none</literal>
378EOF</userinput></screen>
379
380 <para>
381 For additional configuation options, see
382 <command>man 5 NetworkManager.conf</command>.
383 </para>
384
385 <para>
386 To allow regular users permission to configure network connections,
387 you should add them to the
388 <systemitem class="groupname">netdev</systemitem>
389 group, and create a <application>polkit</application> rule that grants
390 access. Run the following commands as the
391 <systemitem class="username">root</systemitem> user:
392 </para>
393
394<screen role="root"><userinput>groupadd -fg 86 netdev &amp;&amp;
395/usr/sbin/usermod -a -G netdev <replaceable>&lt;username&gt;</replaceable>
396
397cat &gt; /usr/share/polkit-1/rules.d/org.freedesktop.NetworkManager.rules &lt;&lt; "EOF"
398<literal>polkit.addRule(function(action, subject) {
399 if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 &amp;&amp; subject.isInGroup("netdev")) {
400 return polkit.Result.YES;
401 }
402});</literal>
403EOF</userinput></screen>
404
405 </sect3>
406
407 <sect3 id="NetworkManager-init">
408 <title><phrase revision="sysv">Boot Script</phrase>
409 <phrase revision="systemd">Systemd Unit</phrase></title>
410
411 <para revision="sysv">
412 To automatically start the <command>NetworkManager</command> daemon
413 when the system is rebooted, install the
414 <filename>/etc/rc.d/init.d/networkmanager</filename>bootscript from the
415 <xref linkend="bootscripts"/> package.
416 </para>
417
418 <para revision="systemd">
419 To start the <command>NetworkManager</command> daemon at boot, enable
420 the previously installed systemd unit by running the following command
421 as the <systemitem class="username">root</systemitem> user:
422 </para>
423
424 <note>
425 <para>
426 If using <application>Network Manager</application> to manage
427 an interface, any previous configuration for that interface should be
428 removed, and the interface brought down prior to starting
429 <application>Network Manager</application>.
430 </para>
431 </note>
432
433 <indexterm zone="NetworkManager NetworkManager-init">
434 <primary sortas="f-NetworkManager">NetworkManager</primary>
435 </indexterm>
436
437<screen role="root" revision="sysv"><userinput>make install-networkmanager</userinput></screen>
438
439<screen role="root" revision="systemd"><userinput>systemctl enable NetworkManager</userinput></screen>
440
441 <para revision="systemd">
442 <application>NetworkManager</application> also ships a systemd unit
443 called <filename>NetworkManager-wait-online.service</filename> which
444 can be used to prevent services that require network connectivity
445 from starting until <application>NetworkManager</application> has
446 established the connection. To enable it, run the following command
447 as the <systemitem class="username">root</systemitem> user:
448 </para>
449
450<screen role="root" revision="systemd"><userinput>systemctl enable NetworkManager-wait-online</userinput></screen>
451
452 </sect3>
453
454 </sect2>
455
456 <sect2 role="content">
457 <title>Contents</title>
458
459 <segmentedlist>
460 <segtitle>Installed Programs</segtitle>
461 <segtitle>Installed Libraries</segtitle>
462 <segtitle>Installed Directories</segtitle>
463
464 <seglistitem>
465 <seg>
466 NetworkManager, nmcli, nm-online, nmtui, and, symlinked to nmtui:
467 nmtui-connect, nmtui-edit, and nmtui-hostname
468 </seg>
469 <seg>
470 libnm.so and several modules under /usr/lib/NetworkManager
471 </seg>
472 <seg>
473 /etc/NetworkManager,
474 /usr/include/libnm,
475 /usr/lib/NetworkManager,
476 /usr/share/doc/NetworkManager-&NetworkManager-version;,
477 /usr/share/gtk-doc/html/{libnm,NetworkManager}
478 (if the documentation is built),
479 and
480 /var/lib/NetworkManager
481 </seg>
482 <!-- A lot of libraries were removed here. We should verify compatibilty. -->
483 </seglistitem>
484 </segmentedlist>
485
486 <variablelist>
487 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
488 <?dbfo list-presentation="list"?>
489 <?dbhtml list-presentation="table"?>
490
491 <varlistentry id="nmcli">
492 <term><command>nmcli</command></term>
493 <listitem>
494 <para>
495 is a command-line tool for controlling
496 <application>NetworkManager</application>
497 and getting its status.
498 </para>
499 <indexterm zone="NetworkManager nmcli">
500 <primary sortas="b-nmcli">nmcli</primary>
501 </indexterm>
502 </listitem>
503 </varlistentry>
504
505 <varlistentry id="nm-online">
506 <term><command>nm-online</command></term>
507 <listitem>
508 <para>
509 is a utility to find out whether you are online.
510 </para>
511 <indexterm zone="NetworkManager nm-online">
512 <primary sortas="b-nm-online">nm-online</primary>
513 </indexterm>
514 </listitem>
515 </varlistentry>
516
517 <varlistentry id="nmtui">
518 <term><command>nmtui</command></term>
519 <listitem>
520 <para>
521 is an interactive ncurses based interface for
522 <application>nmcli</application>.
523 </para>
524 <indexterm zone="NetworkManager nmtui">
525 <primary sortas="b-nmtui">nmtui</primary>
526 </indexterm>
527 </listitem>
528 </varlistentry>
529
530 <varlistentry id="nmtui-connect">
531 <term><command>nmtui-connect</command></term>
532 <listitem>
533 <para>
534 is an interactive ncurses based interface connection to
535 activate/deactivate connections.
536 </para>
537 <indexterm zone="NetworkManager nmtui-connect">
538 <primary sortas="b-nmtui-connect">nmtui-connect</primary>
539 </indexterm>
540 </listitem>
541 </varlistentry>
542
543 <varlistentry id="nmtui-edit">
544 <term><command>nmtui-edit</command></term>
545 <listitem>
546 <para>
547 is an interactive ncurses based interface connection editor.
548 </para>
549 <indexterm zone="NetworkManager nmtui-edit">
550 <primary sortas="b-nmtui-edit">nmtui-edit</primary>
551 </indexterm>
552 </listitem>
553 </varlistentry>
554
555 <varlistentry id="nmtui-hostname">
556 <term><command>nmtui-hostname</command></term>
557 <listitem>
558 <para>
559 is an interactive ncurses based interface hostname editor.
560 </para>
561 <indexterm zone="NetworkManager nmtui-hostname">
562 <primary sortas="b-nmtui-hostname">nmtui-hostname</primary>
563 </indexterm>
564 </listitem>
565 </varlistentry>
566
567 <varlistentry id="NetworkManager-prog">
568 <term><command>NetworkManager</command></term>
569 <listitem>
570 <para>
571 is the network management daemon.
572 </para>
573 <indexterm zone="NetworkManager NetworkManager-prog">
574 <primary sortas="b-NetworkManager">NetworkManager</primary>
575 </indexterm>
576 </listitem>
577 </varlistentry>
578
579 <varlistentry id="libnm">
580 <term><filename class="libraryfile">libnm.so</filename></term>
581 <listitem>
582 <para>
583 contains functions used by <application>NetworkManager</application>.
584 </para>
585 <indexterm zone="NetworkManager libnm">
586 <primary sortas="c-libnm">libnm.so</primary>
587 </indexterm>
588 </listitem>
589 </varlistentry>
590
591 </variablelist>
592
593 </sect2>
594
595</sect1>
Note: See TracBrowser for help on using the repository browser.