source: networking/netprogs/wpa_supplicant.xml@ ca66edf

12.0 12.1 kea ken/TL2024 ken/tuningfonts lazarus lxqt plabs/newcss python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since ca66edf was ca66edf, checked in by Xi Ruoyao <xry111@…>, 14 months ago

Clarify wireless kernel requirements

  • Property mode set to 100644
File size: 21.0 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 wpa_supplicant-download-http
8 "https://w1.fi/releases/wpa_supplicant-&wpa_supplicant-version;.tar.gz">
9 <!ENTITY wpa_supplicant-download-ftp " ">
10 <!ENTITY wpa_supplicant-md5sum "d26797fcb002898d4ee989179346e1cc">
11 <!ENTITY wpa_supplicant-size "3.4 MB">
12 <!ENTITY wpa_supplicant-buildsize "37 MB">
13 <!ENTITY wpa_supplicant-time "0.5 SBU (with optional gui)">
14]>
15
16<sect1 id="wpa_supplicant" xreflabel="wpa_supplicant-&wpa_supplicant-version;">
17 <?dbhtml filename="wpa_supplicant.html"?>
18
19
20 <title>wpa_supplicant-&wpa_supplicant-version;</title>
21
22 <indexterm zone="wpa_supplicant">
23 <primary sortas="a-wpa_supplicant">wpa_supplicant</primary>
24 </indexterm>
25
26 <sect2 role="package">
27 <title>Introduction to WPA Supplicant</title>
28
29 <para>
30 <application>WPA Supplicant</application> is a Wi-Fi Protected Access
31 (WPA) client and IEEE 802.1X supplicant. It implements WPA key negotiation
32 with a WPA Authenticator and Extensible Authentication Protocol (EAP)
33 authentication with an Authentication Server. In addition, it controls the
34 roaming and IEEE 802.11 authentication/association of the wireless LAN
35 driver. This is useful for connecting to a password protected wireless
36 access point.
37 </para>
38
39 &lfs113_checked;
40
41 <bridgehead renderas="sect3">Package Information</bridgehead>
42 <itemizedlist spacing="compact">
43 <listitem>
44 <para>
45 Download (HTTP): <ulink url="&wpa_supplicant-download-http;"/>
46 </para>
47 </listitem>
48 <listitem>
49 <para>
50 Download (FTP): <ulink url="&wpa_supplicant-download-ftp;"/>
51 </para>
52 </listitem>
53 <listitem>
54 <para>
55 Download MD5 sum: &wpa_supplicant-md5sum;
56 </para>
57 </listitem>
58 <listitem>
59 <para>
60 Download size: &wpa_supplicant-size;
61 </para>
62 </listitem>
63 <listitem>
64 <para>
65 Estimated disk space required: &wpa_supplicant-buildsize;
66 </para>
67 </listitem>
68 <listitem>
69 <para>
70 Estimated build time: &wpa_supplicant-time;
71 </para>
72 </listitem>
73 </itemizedlist>
74
75 <bridgehead renderas="sect3">WPA Supplicant Dependencies</bridgehead>
76
77 <bridgehead renderas="sect4">Required (Runtime)</bridgehead>
78 <para role="nodump">
79 <xref linkend="wireless-kernel"/>
80 </para>
81
82 <bridgehead renderas="sect4">Recommended</bridgehead>
83 <para role="recommended">
84 <xref linkend="desktop-file-utils"/> (for running
85 <command>update-desktop-database</command>) and
86 <xref linkend="libnl"/>
87 </para>
88
89 <bridgehead renderas="sect4">Optional</bridgehead>
90 <para role="optional">
91 <phrase revision="sysv"><xref linkend="dbus"/>,</phrase>
92 <xref linkend="libxml2"/>, and
93 <xref linkend="qt5"/>
94 </para>
95
96 <para condition="html" role="usernotes">User Notes:
97 <ulink url="&blfs-wiki;/wpa_supplicant"/>
98 </para>
99
100 </sect2>
101
102 <sect2 role="kernel" id="wpa_supplicant-kernel">
103 <title>Kernel Configuration</title>
104
105 <para>
106 To use <application>wpa_supplicant</application>, the kernel must have
107 the appropriate drivers and other support available. Read
108 <xref linkend='wireless-kernel'/> for details.
109 </para>
110
111 <indexterm zone="wpa_supplicant wpa_supplicant-kernel">
112 <primary sortas="d-wpa_supplicant">wpa_supplicant</primary>
113 </indexterm>
114 </sect2>
115
116 <sect2 role="installation">
117 <title>Installation of WPA Supplicant</title>
118
119 <para>
120 First you will need to create an initial configuration file for the
121 build process. You can read <filename>wpa_supplicant/README</filename>
122 and <filename>wpa_supplicant/defconfig</filename> for the explanation
123 of the following options as well as other options that can be used.
124 Create a build configuration file that should work for standard WiFi
125 setups by running the following command:
126 </para>
127
128<screen><userinput>cat &gt; wpa_supplicant/.config &lt;&lt; "EOF"
129<literal>CONFIG_BACKEND=file
130CONFIG_CTRL_IFACE=y
131CONFIG_DEBUG_FILE=y
132CONFIG_DEBUG_SYSLOG=y
133CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON
134CONFIG_DRIVER_NL80211=y
135CONFIG_DRIVER_WEXT=y
136CONFIG_DRIVER_WIRED=y
137CONFIG_EAP_GTC=y
138CONFIG_EAP_LEAP=y
139CONFIG_EAP_MD5=y
140CONFIG_EAP_MSCHAPV2=y
141CONFIG_EAP_OTP=y
142CONFIG_EAP_PEAP=y
143CONFIG_EAP_TLS=y
144CONFIG_EAP_TTLS=y
145CONFIG_IEEE8021X_EAPOL=y
146CONFIG_IPV6=y
147CONFIG_LIBNL32=y
148CONFIG_PEERKEY=y
149CONFIG_PKCS12=y
150CONFIG_READLINE=y
151CONFIG_SMARTCARD=y
152CONFIG_WPS=y
153CFLAGS += -I/usr/include/libnl3</literal>
154EOF</userinput></screen>
155
156 <para>
157 If you wish to use <application>WPA Supplicant</application> with
158 <xref linkend="NetworkManager"/>, make sure that you have installed
159 <xref linkend="dbus"/> and <xref linkend="libxml2"/>, then add the
160 following options to the <application>WPA Supplicant</application>
161 build configuration file by running the following command:
162 </para>
163
164<screen><userinput>cat &gt;&gt; wpa_supplicant/.config &lt;&lt; "EOF"
165<literal>CONFIG_CTRL_IFACE_DBUS=y
166CONFIG_CTRL_IFACE_DBUS_NEW=y
167CONFIG_CTRL_IFACE_DBUS_INTRO=y</literal>
168EOF</userinput></screen>
169
170<screen><userinput>cd wpa_supplicant &amp;&amp;
171make BINDIR=/usr/sbin LIBDIR=/usr/lib</userinput></screen>
172
173 <para>
174 If you have installed <xref linkend="qt5"/> and wish to build
175 the <application>WPA Supplicant</application> GUI program, run
176 the following commands:
177 </para>
178
179 <note>
180 <para>
181 The following directory name is labelled qt4, but
182 is compatible with <xref linkend="qt5"/>.
183 </para>
184 </note>
185
186<screen><userinput>pushd wpa_gui-qt4 &amp;&amp;
187qmake wpa_gui.pro &amp;&amp;
188make &amp;&amp;
189popd</userinput></screen>
190
191 <para>
192 This package does not come with a test suite.
193 </para>
194
195 <para>
196 Now, as the <systemitem class="username">root</systemitem> user:
197 </para>
198
199<screen role="root"><userinput>install -v -m755 wpa_{cli,passphrase,supplicant} /usr/sbin/ &amp;&amp;
200install -v -m644 doc/docbook/wpa_supplicant.conf.5 /usr/share/man/man5/ &amp;&amp;
201install -v -m644 doc/docbook/wpa_{cli,passphrase,supplicant}.8 /usr/share/man/man8/</userinput></screen>
202
203 <para revision="systemd">
204 Install the <application>systemd</application> support files by
205 running the following command as the <systemitem
206 class="username">root</systemitem> user:
207 </para>
208
209<screen role="root" revision="systemd"><userinput>install -v -m644 systemd/*.service /usr/lib/systemd/system/</userinput></screen>
210
211 <para>
212 If you have built <application>WPA Supplicant</application> with
213 <application>D-Bus</application> support, you will need to install
214 <application>D-Bus</application> configuration files. Install them
215 by running the following commands as the
216 <systemitem class="username">root</systemitem> user:
217 </para>
218
219<screen role="root"><userinput>install -v -m644 dbus/fi.w1.wpa_supplicant1.service \
220 /usr/share/dbus-1/system-services/ &amp;&amp;
221install -v -d -m755 /etc/dbus-1/system.d &amp;&amp;
222install -v -m644 dbus/dbus-wpa_supplicant.conf \
223 /etc/dbus-1/system.d/wpa_supplicant.conf</userinput></screen>
224
225 <para revision="systemd">
226 Additionally, enable the <filename>wpa_supplicant.service</filename>
227 so that <application>systemd</application> can properly activate the
228 <application>D-Bus</application> service. Note that the
229 per-connection service and the D-Bus service cannot be enabled
230 at the same time. Run the following command as the
231 <systemitem class="username">root</systemitem> user:
232 </para>
233
234<screen role="root" revision="systemd"><userinput>systemctl enable wpa_supplicant</userinput></screen>
235
236 <para>
237 If you have built the <application>WPA Supplicant</application> GUI
238 program, install it by running the following commands as the
239 <systemitem class="username">root</systemitem> user:
240 </para>
241
242<screen role="root"><userinput>install -v -m755 wpa_gui-qt4/wpa_gui /usr/bin/ &amp;&amp;
243install -v -m644 doc/docbook/wpa_gui.8 /usr/share/man/man8/ &amp;&amp;
244install -v -m644 wpa_gui-qt4/wpa_gui.desktop /usr/share/applications/ &amp;&amp;
245install -v -m644 wpa_gui-qt4/icons/wpa_gui.svg /usr/share/pixmaps/</userinput></screen>
246
247 <note>
248 <para>
249 You will need to restart the system <application>D-Bus</application> daemon
250 before you can use the <application>WPA Supplicant</application>
251 <application>D-Bus</application> interface.
252 </para>
253 </note>
254
255 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
256 href="../../xincludes/update-desktop-database.xml"/>
257
258 </sect2>
259
260 <sect2 role="configuration">
261 <title>Configuring wpa_supplicant</title>
262
263 <sect3 id="wpa_supplicant-config">
264 <title>Config File</title>
265
266 <para revision="sysv">
267 <filename>/etc/sysconfig/wpa_supplicant-*.conf</filename>
268 </para>
269
270 <para revision="systemd">
271 <filename>/etc/wpa_supplicant/wpa_supplicant-*.conf</filename>
272 </para>
273
274 <indexterm zone="wpa_supplicant wpa_supplicant-config" revision="sysv">
275 <primary
276 sortas="e-etc-sysconfig-wpa_supplicant-star.conf">/etc/sysconfig/wpa_supplicant-*.conf</primary>
277 </indexterm>
278
279 <indexterm zone="wpa_supplicant wpa_supplicant-config" revision="systemd">
280 <primary
281 sortas="e-etc-wpa_supplicant-wpa_supplicant-star.conf">/etc/wpa_supplicant/wpa_supplicant-*.conf</primary>
282 </indexterm>
283
284 </sect3>
285
286 <sect3>
287 <title>Configuration Information</title>
288
289 <para>
290 To connect to an access point that uses a password, you need to put
291 the pre-shared key in
292 <phrase revision="sysv">
293 <filename>
294 /etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</filename>.
295 </phrase>
296 <phrase revision="systemd">
297 <filename>
298 /etc/wpa_supplicant/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</filename>.
299 </phrase>
300 SSID is the string that the access point/router transmits to
301 identify itself. Run the following command as the
302 <systemitem class="username">root</systemitem> user:
303 </para>
304
305<screen role="nodump" revision="sysv"><userinput>wpa_passphrase <replaceable>SSID</replaceable> <replaceable>SECRET_PASSWORD</replaceable> &gt; /etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</userinput></screen>
306
307<screen role="nodump" revision="systemd"><userinput>install -v -dm755 /etc/wpa_supplicant &amp;&amp;
308wpa_passphrase <replaceable>SSID</replaceable> <replaceable>SECRET_PASSWORD</replaceable> &gt; /etc/wpa_supplicant/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</userinput></screen>
309
310 <para>
311 <phrase revision="sysv">
312 <filename>
313 /etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf
314 </filename>
315 </phrase>
316 <phrase revision="systemd">
317 <filename>
318 /etc/wpa_supplicant/wpa_supplicant-<replaceable>wifi0</replaceable>.conf
319 </filename>
320 </phrase>
321 can hold the details of several access points. When
322 <command>wpa_supplicant</command> is started, it will scan for the
323 SSIDs it can see and choose the appropriate password to connect.
324 </para>
325
326 <para>
327 If you want to connect to an access point that isn't password
328 protected, put an entry like this in
329 <phrase revision="sysv">
330 <filename>
331/etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</filename>.
332 </phrase>
333 <phrase revision="systemd">
334 <filename>
335/etc/wpa_supplicant/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</filename>.
336 </phrase>
337 Replace "Some-SSID" with the SSID of the access point/router.
338 </para>
339
340<screen>network={
341 ssid="<replaceable>Some-SSID</replaceable>"
342 key_mgmt=NONE
343}</screen>
344
345 <para>
346 Connecting to a new access point that is not in the configuration
347 file can be accomplished manually via the command line or GUI, but it
348 must be done via a privileged user. To do that, add the following to
349 the configuration file:
350 </para>
351
352<screen>ctrl_interface=DIR=/run/wpa_supplicant GROUP=&lt;privileged group&gt;
353update_config=1</screen>
354
355 <para>
356 Replace the &lt;privileged group&gt; above with a system group where
357 members have the ability to connect to a wireless access point.
358 </para>
359
360 <para>
361 There are many options that you could use to tweak how you connect
362 to each access point. They are described in some detail in the
363 <filename>wpa_supplicant/wpa_supplicant.conf</filename> file in the
364 source tree.
365 </para>
366
367 </sect3>
368
369 <sect3>
370 <title>Connecting to an Access Point</title>
371
372 <para id="wpa-service" revision="sysv">
373 If you want to configure network interfaces at boot using
374 <command>wpa_supplicant</command>, you need to install the
375 <filename>/lib/services/wpa</filename> script
376 included in <xref linkend="bootscripts"/> package:
377 </para>
378
379<screen role="root" revision="sysv"><userinput>make install-service-wpa</userinput></screen>
380
381 <indexterm zone="wpa_supplicant wpa-service" revision="sysv">
382 <primary sortas="f-wpa">wpa</primary>
383 </indexterm>
384
385 <para revision="sysv">
386 If your router/access point uses DHCP to allocate IP addresses, you
387 can install <xref linkend="dhcp"/> client and use it to
388 automatically obtain network addresses. Create the
389 <filename>/etc/sysconfig/ifconfig-<replaceable>wifi0</replaceable>
390 </filename> by running the following command as the
391 <systemitem class="username">root</systemitem> user:
392 </para>
393
394<screen role="root" revision="sysv"><userinput>cat &gt; /etc/sysconfig/ifconfig.<replaceable>wifi0</replaceable> &lt;&lt; "EOF"
395<literal>ONBOOT="yes"
396IFACE="<replaceable>wlan0</replaceable>"
397SERVICE="wpa"
398
399# Additional arguments to wpa_supplicant
400WPA_ARGS=""
401
402WPA_SERVICE="dhclient"
403DHCP_START=""
404DHCP_STOP=""
405
406# Set PRINTIP="yes" to have the script print
407# the DHCP assigned IP address
408PRINTIP="no"
409
410# Set PRINTALL="yes" to print the DHCP assigned values for
411# IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
412PRINTALL="no"</literal>
413EOF</userinput></screen>
414
415 <para revision="sysv">
416 If you prefer <xref linkend="dhcpcd"/> instead of
417 <xref linkend="dhcp"/> client, then create the
418 <filename>/etc/sysconfig/ifconfig-<replaceable>wifi0</replaceable>
419 </filename> by running the following command as the
420 <systemitem class="username">root</systemitem> user:
421 </para>
422
423<screen role="root" revision="sysv"><userinput>cat &gt; /etc/sysconfig/ifconfig.<replaceable>wifi0</replaceable> &lt;&lt; "EOF"
424<literal>ONBOOT="yes"
425IFACE="<replaceable>wlan0</replaceable>"
426SERVICE="wpa"
427
428# Additional arguments to wpa_supplicant
429WPA_ARGS=""
430
431WPA_SERVICE="dhcpcd"
432DHCP_START="-b -q <replaceable>&lt;insert appropriate start options here&gt;</replaceable>"
433DHCP_STOP="-k <replaceable>&lt;insert additional stop options here&gt;</replaceable>"</literal>
434EOF</userinput></screen>
435
436 <para revision="sysv">
437 Alternatively, if you use static addresses on your local network,
438 then create the
439 <filename>/etc/sysconfig/ifconfig-<replaceable>wifi0</replaceable>
440 </filename> by running the following command as the
441 <systemitem class="username">root</systemitem> user:
442 </para>
443
444<screen role="root" revision="sysv"><userinput>cat &gt; /etc/sysconfig/ifconfig.<replaceable>wifi0</replaceable> &lt;&lt; "EOF"
445<literal>ONBOOT="yes"
446IFACE="<replaceable>wlan0</replaceable>"
447SERVICE="wpa"
448
449# Additional arguments to wpa_supplicant
450WPA_ARGS=""
451
452WPA_SERVICE="ipv4-static"
453IP="192.168.1.1"
454GATEWAY="192.168.1.2"
455PREFIX="24"
456BROADCAST="192.168.1.255"</literal>
457EOF</userinput></screen>
458
459 <para revision="systemd">
460 There are 3 types of <application>systemd</application> units
461 that were installed:
462 </para>
463
464 <itemizedlist spacing="compact" revision="systemd">
465 <listitem>
466 <para>
467 wpa_supplicant@.service
468 </para>
469 </listitem>
470 <listitem>
471 <para>
472 wpa_supplicant-nl80211@.service
473 </para>
474 </listitem>
475 <listitem>
476 <para>
477 wpa_supplicant-wired@.service
478 </para>
479 </listitem>
480 </itemizedlist>
481
482 <para revision="systemd">
483 The only difference between 3 of them is what driver
484 is used for connecting (-D option). The first one uses
485 the default driver, the second one uses the nl80211
486 driver and the third one uses the wired driver.
487 </para>
488
489 <para>
490 You can connect to the wireless access point by
491 running the following command as the
492 <systemitem class="username">root</systemitem> user:
493 </para>
494
495<screen role="root" revision="sysv"><userinput>ifup <replaceable>wifi0</replaceable></userinput></screen>
496
497 <para revision="sysv">
498 Replace <replaceable>wlan0</replaceable> with the correct
499 wireless interface and <replaceable>wifi0</replaceable>
500 with desired name for the configuration file. Please note
501 that <filename>wpa_supplicant-*.conf</filename> and
502 <filename>ifconfig.*</filename> configuration files need
503 to have identical names, ie both contain
504 <replaceable>wifi0</replaceable> in their name.
505 </para>
506
507<screen role="root" revision="systemd"><userinput>systemctl start wpa_supplicant@<replaceable>wlan0</replaceable></userinput></screen>
508
509 <para revision="systemd">
510 To connect to the wireless access point at
511 boot, simply enable the appropriate
512 <command>wpa_supplicant</command> service
513 by running the following command as the
514 <systemitem class="username">root</systemitem> user:
515 </para>
516
517<screen role="root" revision="systemd"><userinput>systemctl enable wpa_supplicant@<replaceable>wlan0</replaceable></userinput></screen>
518
519 <para revision="systemd">
520 Depending on your setup, you can replace the
521 <filename>wpa_supplicant@.service</filename>
522 with any other listed above.
523 </para>
524
525 <para revision="systemd">
526 To assign a network address to your wireless interface, consult the
527 <ulink url="&lfs-root;/chapter09/network.html">General Network Configuration</ulink>
528 page in LFS.
529 </para>
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 wpa_gui, wpa_supplicant, wpa_passphrase and wpa_cli
546 </seg>
547 <seg>
548 None
549 </seg>
550 <seg>
551 None
552 </seg>
553 </seglistitem>
554 </segmentedlist>
555
556 <variablelist>
557 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
558 <?dbfo list-presentation="list"?>
559 <?dbhtml list-presentation="table"?>
560
561 <varlistentry id="wpa_gui">
562 <term><command>wpa_gui</command></term>
563 <listitem>
564 <para>
565 is a graphical frontend program for interacting with
566 <application>wpa_supplicant</application>
567 </para>
568 <indexterm zone="wpa_supplicant wpa_gui">
569 <primary sortas="b-wpa_gui">wpa_gui</primary>
570 </indexterm>
571 </listitem>
572 </varlistentry>
573
574 <varlistentry id="wpa_supplicant-prog">
575 <term><command>wpa_supplicant</command></term>
576 <listitem>
577 <para>
578 is a daemon that can connect to a password protected wireless
579 access point
580 </para>
581 <indexterm zone="wpa_supplicant wpa_supplicant-prog">
582 <primary sortas="b-wpa_supplicant">wpa_supplicant</primary>
583 </indexterm>
584 </listitem>
585 </varlistentry>
586
587 <varlistentry id="wpa_passphrase">
588 <term><command>wpa_passphrase</command></term>
589 <listitem>
590 <para>
591 takes an SSID and a password and generates a simple
592 configuration that <command>wpa_supplicant</command> can
593 understand
594 </para>
595 <indexterm zone="wpa_supplicant wpa_passphrase">
596 <primary sortas="b-wpa_passphrase">wpa_passphrase</primary>
597 </indexterm>
598 </listitem>
599 </varlistentry>
600
601 <varlistentry id="wpa_cli">
602 <term><command>wpa_cli</command></term>
603 <listitem>
604 <para>
605 is a command line interface used to control a running
606 <command>wpa_supplicant</command> daemon
607 </para>
608 <indexterm zone="wpa_supplicant wpa_cli">
609 <primary sortas="b-wpa_cli">wpa_cli</primary>
610 </indexterm>
611 </listitem>
612 </varlistentry>
613
614 </variablelist>
615
616 </sect2>
617
618</sect1>
Note: See TracBrowser for help on using the repository browser.