source: networking/netprogs/wpa_supplicant.xml@ ed345e7

12.0 12.1 ken/TL2024 ken/tuningfonts lazarus plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18
Last change on this file since ed345e7 was ed345e7, checked in by Douglas R. Reno <renodr@…>, 10 months ago

Tags

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