source: networking/netprogs/wpa_supplicant.xml

trunk
Last change on this file was f67c5c8, checked in by Bruce Dubbs <bdubbs@…>, 2 months ago

Update to kde-apps-23.08.5 and associated tags.

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