source: networking/netutils/networkmanager.xml

trunk
Last change on this file was c0bc0a9, checked in by Xi Ruoyao <xry111@…>, 5 weeks ago

Update to glib-2.80.0 and gobject-introspection-1.80.0

Merge gobject-introspection into glib page to better handle a circular
dependency between these two packages.

  • Property mode set to 100644
File size: 23.6 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
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/&NetworkManager-minor;/NetworkManager-&NetworkManager-version;.tar.xz">
9 <!ENTITY NetworkManager-download-ftp " ">
10 <!ENTITY NetworkManager-md5sum "0594a237e7182341dd39cf465b1b60fe">
11 <!ENTITY NetworkManager-size "6.7 MB">
12 <!ENTITY NetworkManager-buildsize "936 MB (with tests and documentation)">
13 <!ENTITY NetworkManager-time "0.8 SBU (with tests, using parallelism=4)">
14]>
15
16<sect1 id="NetworkManager" xreflabel="NetworkManager-&NetworkManager-version;">
17 <?dbhtml filename="networkmanager.html"?>
18
19
20 <title>NetworkManager-&NetworkManager-version;</title>
21
22 <indexterm zone="NetworkManager">
23 <primary sortas="a-NetworkManager">NetworkManager</primary>
24 </indexterm>
25
26 <sect2 role="package">
27 <title>Introduction to NetworkManager</title>
28
29 <para>
30 <application>NetworkManager</application> is a set of co-operative
31 tools that make networking simple and straightforward. Whether you use WiFi,
32 wired, 3G, or Bluetooth, NetworkManager allows you to quickly move from
33 one network to another: Once a network has been configured and joined
34 once, it can be detected and re-joined automatically the next time it's
35 available.
36 </para>
37
38 &lfs121_checked;
39
40 <note revision="systemd">
41 <para>
42 Make sure that you disable the <command>systemd-networkd</command>
43 service or configure it not to manage the interfaces you want to manage
44 with <application>NetworkManager</application>.
45 </para>
46 </note>
47
48 <bridgehead renderas="sect3">Package Information</bridgehead>
49 <itemizedlist spacing="compact">
50 <listitem>
51 <para>
52 Download (HTTP): <ulink url="&NetworkManager-download-http;"/>
53 </para>
54 </listitem>
55 <listitem>
56 <para>
57 Download (FTP): <ulink url="&NetworkManager-download-ftp;"/>
58 </para>
59 </listitem>
60 <listitem>
61 <para>
62 Download MD5 sum: &NetworkManager-md5sum;
63 </para>
64 </listitem>
65 <listitem>
66 <para>
67 Download size: &NetworkManager-size;
68 </para>
69 </listitem>
70 <listitem>
71 <para>
72 Estimated disk space required: &NetworkManager-buildsize;
73 </para>
74 </listitem>
75 <listitem>
76 <para>
77 Estimated build time: &NetworkManager-time;
78 </para>
79 </listitem>
80 </itemizedlist>
81
82 <bridgehead renderas="sect3">NetworkManager Dependencies</bridgehead>
83
84 <bridgehead renderas="sect4">Required</bridgehead>
85 <para role="required">
86 <xref linkend="libndp"/>
87 </para>
88
89 <bridgehead renderas="sect4">Recommended</bridgehead>
90 <para role="recommended">
91 <xref linkend="curl"/>,
92 <xref linkend="dhcpcd"/>,
93 &gobject-introspection;,
94 <xref linkend="iptables"/>,
95 <xref linkend="libpsl"/>,
96 <xref linkend="newt"/> (for <command>nmtui</command>),
97 <xref linkend="nss"/>,
98 <xref role='runtime' linkend="polkit"/> (runtime),
99 <xref linkend="pygobject3"/>,
100 <phrase revision="sysv"><xref linkend="elogind"/>,</phrase>
101 <phrase revision="systemd"><xref linkend="systemd"/>,</phrase>
102 <xref linkend="vala"/>, and
103 <xref linkend="wpa_supplicant"/> (runtime, built with D-Bus support)
104 </para>
105
106 <bridgehead renderas="sect4">Optional</bridgehead>
107 <para role="optional">
108 <xref linkend="bluez"/>,
109 <xref linkend="dbus-python"/> (for the test suite),
110 <!-- <xref linkend="firewalld"/> (For whenever firewalld is reintroduced) -->
111 <xref linkend="gnutls"/> (can be used instead of <xref linkend="nss"/>),
112 <xref linkend="gtk-doc"/>,
113 <xref linkend="jansson"/>,
114 <xref linkend="ModemManager"/>,
115 (<xref linkend="qt5"/> or
116 <xref role="node" linkend="qt5-components"/> with qtdoc) (for examples),
117 <xref linkend="upower"/>,
118 <xref linkend="valgrind"/>,
119 <ulink url="https://thekelleys.org.uk/dnsmasq/doc.html">dnsmasq</ulink>,
120 <ulink url="https://firewalld.org/">firewalld</ulink>,
121 <ulink url="https://github.com/Distrotech/libaudit">libaudit</ulink>,
122 <ulink url="https://github.com/jpirko/libteam">libteam</ulink>,
123 <ulink url="&gnome-download-http;/mobile-broadband-provider-info/">mobile-broadband-provider-info</ulink>,
124 <ulink url="https://www.samba.org/ftp/ppp/">PPP</ulink>, and
125 <ulink url="https://dianne.skoll.ca/projects/rp-pppoe/">RP-PPPoE</ulink>
126 </para>
127
128 </sect2>
129
130 <sect2 role="kernel" id="NetworkManager-kernel">
131 <title>Kernel Configuration</title>
132
133 <para>
134 If you wish to run the tests, check that at least the following options
135 are enabled in the kernel configuration. Those options have been
136 determined to be necessary, but may not be sufficient. Recompile the
137 kernel if necessary:
138 </para>
139
140 <!-- Ethernet Teaming support is potentially optional, but I didn't
141 run the tests again to test that. It was needed to convince one of
142 the Linux Platform tests to move farther along because otherwise
143 RTNETLINK would respond with an Error 95 - unknown device type.
144 This would cause the test to fail early on in the process.
145
146 [pierre, Nov 2022]: I cannot tell whether these options are
147 the only ones that are needed. They are the options I had to add
148 in order to have some tests pass. But I already had some other
149 options set for packet filtering (iptables), that may not be
150 available by default and may be necessary. Even with the options
151 below still one test (test-route) fails.-->
152
153 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
154 href="networkmanager-test-kernel.xml"/>
155
156 <indexterm zone="NetworkManager NetworkManager-kernel">
157 <primary sortas="d-NetworkManager">NetworkManager (test)</primary>
158 </indexterm>
159 </sect2>
160
161 <sect2 role="installation">
162 <title>Installation of NetworkManager</title>
163
164 <para>
165 If <xref linkend="qt5"/> is installed and the Qt based
166 examples are desired, fix two meson.build files:
167 </para>
168
169<screen><userinput>sed -e 's/-qt4/-qt5/' \
170 -e 's/moc_location/host_bins/' \
171 -i examples/C/qt/meson.build &amp;&amp;
172
173sed -e 's/Qt/&amp;5/' \
174 -i meson.build</userinput></screen>
175
176<!--
177 <para>
178 Fix a missing meson.build file for initrd hooks (not used in BLFS):
179 </para>
180
181<screen><userinput>sed '/initrd/d' -i src/core/meson.build</userinput></screen>
182-->
183
184 <para>
185 Fix the python scripts so that they use <application>Python
186 3</application>:
187 </para>
188
189<screen><userinput>grep -rl '^#!.*python$' | xargs sed -i '1s/python/&amp;3/'</userinput></screen>
190
191 <para>
192 Install <application>NetworkManager</application> by running the
193 following commands:
194 </para>
195
196<screen revision="sysv"><userinput>mkdir build &amp;&amp;
197cd build &amp;&amp;
198
199CXXFLAGS+="-O2 -fPIC" \
200meson setup .. \
201 --prefix=/usr \
202 --buildtype=release \
203 -Dlibaudit=no \
204 -Dnmtui=true \
205 -Dovs=false \
206 -Dppp=false \
207 -Dselinux=false \
208 -Dsession_tracking=elogind \
209 -Dmodem_manager=false \
210 -Dsystemdsystemunitdir=no \
211 -Dsystemd_journal=false \
212 -Dqt=false &amp;&amp;
213ninja</userinput></screen>
214
215<screen revision="systemd"><userinput>mkdir build &amp;&amp;
216cd build &amp;&amp;
217
218CXXFLAGS+="-O2 -fPIC" \
219meson setup .. \
220 --prefix=/usr \
221 --buildtype=release \
222 -Dlibaudit=no \
223 -Dnmtui=true \
224 -Dovs=false \
225 -Dppp=false \
226 -Dselinux=false \
227 -Dqt=false \
228 -Dsession_tracking=systemd \
229 -Dmodem_manager=false &amp;&amp;
230ninja</userinput></screen>
231
232 <para>
233 An already active graphical session with a bus address is necessary
234 to run the tests. To test the results, issue
235 <command>ninja test</command>.
236 </para>
237
238 <para>
239 A few tests may fail, depending on enabled kernel options.
240 </para>
241
242 <para>
243 Now, as the <systemitem class="username">root</systemitem> user:
244 </para>
245
246<screen role="root"><userinput>ninja install &amp;&amp;
247mv -v /usr/share/doc/NetworkManager{,-&NetworkManager-version;}</userinput></screen>
248
249 <para>
250 If you have not passed the <option>-Ddocs=true</option> option to
251 <command>meson</command>, you can install the pregenerated manual pages
252 with (as the &root; user):
253 </para>
254
255<screen role="root"><userinput>for file in $(echo ../man/*.[1578]); do
256 section=${file##*.} &amp;&amp;
257 install -vdm 755 /usr/share/man/man$section
258 install -vm 644 $file /usr/share/man/man$section/
259done</userinput></screen>
260
261 <para>
262 If you have not used <option>-Ddocs=true</option>, the
263 pregenerated HTML documentation can also be installed with (as
264 the &root; user):
265 </para>
266
267<screen role="root"
268 remap="doc"><userinput>cp -Rv ../docs/{api,libnm} /usr/share/doc/NetworkManager-&NetworkManager-version;</userinput></screen>
269
270 </sect2>
271
272 <sect2 role="commands">
273 <title>Command Explanations</title>
274
275 <para>
276 <envar>CXXFLAGS="-O2 -fPIC"</envar>: These compiler options are
277 necessary to build the Qt5 based examples.
278 </para>
279
280 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
281 href="../../xincludes/meson-buildtype-release.xml"/>
282
283 <para>
284 <option>-Ddocs=true</option>: Use this switch to enable building
285 man pages and documentation if <xref linkend="gtk-doc"/> is installed.
286 </para>
287
288 <para>
289 <parameter>-Dnmtui=true</parameter>: This switch enables building
290 <command>nmtui</command>.
291 </para>
292
293 <para revision="sysv">
294 <parameter>-Dsystemdsystemunitdir=no</parameter> and
295 <parameter>-Dsystemd_journal=false</parameter>: systemd is not
296 used for sysv init systems, so prevent installing units and using the
297 systemd journal.
298 </para>
299
300 <para>
301 <parameter>-Dovs=false</parameter>: This switch disable the Open
302 vSwitch integration because it needs <xref linkend='jansson'/>.
303 Remove it if you have <xref linkend='jansson'/> installed on your
304 system.
305 </para>
306
307 <para>
308 <parameter>-Dmodem_manager=false</parameter>: This switch is required if
309 <application>ModemManager</application> is not installed. Omit this switch
310 if you have built <application>ModemManager</application> and
311 <application>mobile-broadband-provider-info</application>.
312 </para>
313
314 <para revision="sysv">
315 <parameter>-Dsession_tracking=elogind</parameter>: This switch
316 is used to set <command>elogind</command> as the default
317 program for session tracking.
318 </para>
319
320 <para revision="systemd">
321 <parameter>-Dsession_tracking=systemd</parameter>: This switch
322 is used to set <command>systemd-logind</command> as the default
323 program for session tracking.
324 </para>
325<!-- not in instrucitons anymore
326 <para revision="systemd">
327 <parameter>-Dsystemdsystemunitdir=/lib/systemd/system</parameter>:
328 This switch is used to set the correct installation directory for
329 systemd units.
330 </para>
331-->
332 <para>
333 <parameter>-Dppp=false</parameter>: This switch disables
334 <application>PPP</application> support in
335 <application>NetworkManager</application> since the programs necessary
336 for it are not installed. Remove this switch if you need PPP support and
337 have <application>PPP</application> installed.
338 </para>
339
340 <para>
341 <parameter>-Dlibaudit=no</parameter> and
342 <parameter>-Dselinux=false</parameter>: This switch disables support for
343 libaudit and SELinux since they are not used in BLFS.
344 </para>
345
346 <para>
347 <parameter>-Dqt=false</parameter>: This switch disables the
348 <application>Qt</application> examples. Omit if you have
349 <application>Qt</application> available and wish to install the examples.
350 </para>
351
352 <para>
353 <option>-Dcrypto=gnutls</option>: Use this switch if you have GnuTLS
354 installed and want to use it for certificate and key operations in
355 NetworkManager, instead of using NSS (the default).
356 </para>
357
358 <para>
359 <option>-Dcrypto=null</option>: Use this switch if neither NSS nor
360 GnuTLS is installed but you want to build NetworkManager anyway. This
361 switch will make NetworkManager lack some features (for example
362 802.1X).
363 </para>
364
365 <para>
366 <option>-Dsuspend_resume=upower</option>: Use this switch if
367 you have <xref linkend='upower'/> installed and want to use it
368 (instead of &logind;) for suspend and resume support.
369 </para>
370 </sect2>
371
372 <sect2 role="configuration">
373 <title>Configuring NetworkManager</title>
374
375 <sect3 id="NetworkManager-config">
376 <title>Config Files</title>
377 <para>
378 <filename>/etc/NetworkManager/NetworkManager.conf</filename>
379 </para>
380
381 <indexterm zone="NetworkManager NetworkManager-config">
382 <primary
383 sortas="e-etc-NetworkManager-NetworkManager.conf">
384 /etc/NetworkManager/NetworkManager.conf</primary>
385 </indexterm>
386
387 </sect3>
388
389 <sect3><title>Configuration Information</title>
390
391 <para>
392 For <application>NetworkManager</application> to work, at least
393 a minimal configuration file must be present. Such a file is not
394 installed with <command>make install</command>. Issue the following
395 command as the <systemitem class="username">root</systemitem> user to
396 create a minimal <filename>NetworkManager.conf</filename> file:
397 </para>
398
399<screen role="root"><userinput>cat &gt;&gt; /etc/NetworkManager/NetworkManager.conf &lt;&lt; "EOF"
400<literal>[main]
401plugins=keyfile</literal>
402EOF</userinput></screen>
403
404 <para>
405 This file should not be modified directly by users of the system.
406 Instead, system specific changes should be made using configuration
407 files in the
408 <filename class="directory">/etc/NetworkManager/conf.d</filename>
409 directory.
410 </para>
411
412 <para>
413 To allow polkit to manage authorizations, add the following
414 configuration file:
415 </para>
416
417<screen role="root"><userinput>cat &gt; /etc/NetworkManager/conf.d/polkit.conf &lt;&lt; "EOF"
418<literal>[main]
419auth-polkit=true</literal>
420EOF</userinput></screen>
421
422 <para>
423 To use something other than the built-in dhcp client (recommended if
424 using only <command>nmcli</command>), use the following configuration
425 (valid values include either dhcpcd or internal):
426 </para>
427
428<screen role="nodump"><userinput>cat &gt; /etc/NetworkManager/conf.d/dhcp.conf &lt;&lt; "EOF"
429<literal>[main]
430dhcp=</literal><replaceable>dhcpcd</replaceable>
431EOF</userinput></screen>
432
433 <para>
434 To prevent <application>NetworkManager</application> from updating the
435 <filename>/etc/resolv.conf</filename> file, add the following
436 configuration file:
437 </para>
438
439<screen role="nodump"><userinput>cat &gt; /etc/NetworkManager/conf.d/no-dns-update.conf &lt;&lt; "EOF"
440<literal>[main]
441dns=none</literal>
442EOF</userinput></screen>
443
444 <para>
445 For additional configuration options, see
446 <command>man 5 NetworkManager.conf</command>.
447 </para>
448
449 <para>
450 To allow regular users to configure network connections,
451 you should add them to the
452 <systemitem class="groupname">netdev</systemitem>
453 group, and create a <application>polkit</application> rule that grants
454 access. Run the following commands as the
455 <systemitem class="username">root</systemitem> user:
456 </para>
457
458<screen role="root"><userinput>groupadd -fg 86 netdev &amp;&amp;
459/usr/sbin/usermod -a -G netdev <replaceable>&lt;username&gt;</replaceable>
460
461cat &gt; /usr/share/polkit-1/rules.d/org.freedesktop.NetworkManager.rules &lt;&lt; "EOF"
462<literal>polkit.addRule(function(action, subject) {
463 if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 &amp;&amp; subject.isInGroup("netdev")) {
464 return polkit.Result.YES;
465 }
466});</literal>
467EOF</userinput></screen>
468
469 </sect3>
470
471 <sect3 id="NetworkManager-init">
472 <title><phrase revision="sysv">Boot Script</phrase>
473 <phrase revision="systemd">Systemd Unit</phrase></title>
474
475 <para revision="sysv">
476 To automatically start the <command>NetworkManager</command> daemon
477 when the system is rebooted, install the
478 <filename>/etc/rc.d/init.d/networkmanager</filename>bootscript from the
479 <xref linkend="bootscripts"/> package.
480 </para>
481
482 <para revision="systemd">
483 To start the <command>NetworkManager</command> daemon at boot, enable
484 the previously installed systemd unit by running the following command
485 as the <systemitem class="username">root</systemitem> user:
486 </para>
487
488 <note>
489 <para>
490 If using <application>Network Manager</application> to manage
491 an interface, any previous configuration for that interface should be
492 removed, and the interface brought down prior to starting
493 <application>Network Manager</application>.
494 </para>
495 </note>
496
497 <indexterm zone="NetworkManager NetworkManager-init">
498 <primary sortas="f-NetworkManager">NetworkManager</primary>
499 </indexterm>
500
501<screen role="root" revision="sysv"><userinput>make install-networkmanager</userinput></screen>
502
503<screen role="root" revision="systemd"><userinput>systemctl enable NetworkManager</userinput></screen>
504<!-- The below instruction is obsolete. NetworkManager-wait-online is now
505 enabled by default when enabling NetworkManager. -->
506<!--
507 <para revision="systemd">
508 <application>NetworkManager</application> also ships a systemd unit
509 called <filename>NetworkManager-wait-online.service</filename> which
510 can be used to prevent services that require network connectivity
511 from starting until <application>NetworkManager</application> has
512 established the connection. To enable it, run the following command
513 as the <systemitem class="username">root</systemitem> user:
514 </para>
515
516<screen role="root" revision="systemd"><userinput>systemctl enable NetworkManager-wait-online</userinput></screen>
517 -->
518 <!-- As such, let's now provide instructions on how to disable that
519 behavior, for those who wish to do so. -->
520 <para revision="systemd">
521 Starting in version 1.11.2 of <application>NetworkManager</application>,
522 a systemd unit named <filename>NetworkManager-wait-online.service</filename>
523 is enabled, which is used to prevent services that require network
524 connectivity from starting until <application>NetworkManager</application>
525 establishes a connection. To disable this behavior, run the following
526 command as the <systemitem class="username">root</systemitem> user:
527 </para>
528
529<screen role="root" revision="systemd"><userinput>systemctl disable NetworkManager-wait-online</userinput></screen>
530
531 </sect3>
532
533 </sect2>
534
535 <sect2 role="content">
536 <title>Contents</title>
537
538 <segmentedlist>
539 <segtitle>Installed Programs</segtitle>
540 <segtitle>Installed Libraries</segtitle>
541 <segtitle>Installed Directories</segtitle>
542
543 <seglistitem>
544 <seg>
545 NetworkManager, nmcli, nm-online, nmtui, and, symlinked to nmtui:
546 nmtui-connect, nmtui-edit, and nmtui-hostname
547 </seg>
548 <seg>
549 libnm.so
550 and several modules under /usr/lib/NetworkManager
551 </seg>
552 <seg>
553 /etc/NetworkManager,
554 /usr/include/libnm,
555 /usr/lib/NetworkManager,
556 /usr/share/doc/NetworkManager-&NetworkManager-version;,
557 /usr/share/gtk-doc/html/{libnm,NetworkManager}
558 (if the documentation is built),
559 and
560 /var/lib/NetworkManager
561 </seg>
562 </seglistitem>
563 </segmentedlist>
564
565 <variablelist>
566 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
567 <?dbfo list-presentation="list"?>
568 <?dbhtml list-presentation="table"?>
569
570 <varlistentry id="nmcli">
571 <term><command>nmcli</command></term>
572 <listitem>
573 <para>
574 is a command-line tool for controlling
575 <application>NetworkManager</application>
576 and getting its status
577 </para>
578 <indexterm zone="NetworkManager nmcli">
579 <primary sortas="b-nmcli">nmcli</primary>
580 </indexterm>
581 </listitem>
582 </varlistentry>
583
584 <varlistentry id="nm-online">
585 <term><command>nm-online</command></term>
586 <listitem>
587 <para>
588 is an utility to determine whether you are online
589 </para>
590 <indexterm zone="NetworkManager nm-online">
591 <primary sortas="b-nm-online">nm-online</primary>
592 </indexterm>
593 </listitem>
594 </varlistentry>
595
596 <varlistentry id="nmtui">
597 <term><command>nmtui</command></term>
598 <listitem>
599 <para>
600 is an interactive ncurses-based user interface for
601 <application>nmcli</application>
602 </para>
603 <indexterm zone="NetworkManager nmtui">
604 <primary sortas="b-nmtui">nmtui</primary>
605 </indexterm>
606 </listitem>
607 </varlistentry>
608
609 <varlistentry id="nmtui-connect">
610 <term><command>nmtui-connect</command></term>
611 <listitem>
612 <para>
613 is an interactive ncurses-based user interface to
614 activate/deactivate connections
615 </para>
616 <indexterm zone="NetworkManager nmtui-connect">
617 <primary sortas="b-nmtui-connect">nmtui-connect</primary>
618 </indexterm>
619 </listitem>
620 </varlistentry>
621
622 <varlistentry id="nmtui-edit">
623 <term><command>nmtui-edit</command></term>
624 <listitem>
625 <para>
626 is an interactive ncurses-based user interface to edit connections
627 </para>
628 <indexterm zone="NetworkManager nmtui-edit">
629 <primary sortas="b-nmtui-edit">nmtui-edit</primary>
630 </indexterm>
631 </listitem>
632 </varlistentry>
633
634 <varlistentry id="nmtui-hostname">
635 <term><command>nmtui-hostname</command></term>
636 <listitem>
637 <para>
638 is an interactive ncurses-based user interface to edit the hostname
639 </para>
640 <indexterm zone="NetworkManager nmtui-hostname">
641 <primary sortas="b-nmtui-hostname">nmtui-hostname</primary>
642 </indexterm>
643 </listitem>
644 </varlistentry>
645
646 <varlistentry id="NetworkManager-prog">
647 <term><command>NetworkManager</command></term>
648 <listitem>
649 <para>
650 is the network management daemon
651 </para>
652 <indexterm zone="NetworkManager NetworkManager-prog">
653 <primary sortas="b-NetworkManager">NetworkManager</primary>
654 </indexterm>
655 </listitem>
656 </varlistentry>
657
658 <varlistentry id="libnm">
659 <term><filename class="libraryfile">libnm.so</filename></term>
660 <listitem>
661 <para>
662 contains functions used by <application>NetworkManager</application>
663 </para>
664 <indexterm zone="NetworkManager libnm">
665 <primary sortas="c-libnm">libnm.so</primary>
666 </indexterm>
667 </listitem>
668 </varlistentry>
669 </variablelist>
670
671 </sect2>
672
673</sect1>
Note: See TracBrowser for help on using the repository browser.