[a130a69] | 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
|
---|
[8dfc5c3] | 8 | "https://w1.fi/releases/wpa_supplicant-&wpa_supplicant-version;.tar.gz">
|
---|
[4c869cdd] | 9 | <!ENTITY wpa_supplicant-download-ftp " ">
|
---|
[56da7c7a] | 10 | <!ENTITY wpa_supplicant-md5sum "d26797fcb002898d4ee989179346e1cc">
|
---|
| 11 | <!ENTITY wpa_supplicant-size "3.4 MB">
|
---|
| 12 | <!ENTITY wpa_supplicant-buildsize "37 MB">
|
---|
[09cbfce] | 13 | <!ENTITY wpa_supplicant-time "0.5 SBU (with optional gui)">
|
---|
[a130a69] | 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">
|
---|
[4c869cdd] | 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>
|
---|
[a130a69] | 38 |
|
---|
[d0c42be] | 39 | &lfs113_checked;
|
---|
[5603a81] | 40 |
|
---|
[a130a69] | 41 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 42 | <itemizedlist spacing="compact">
|
---|
| 43 | <listitem>
|
---|
[4c869cdd] | 44 | <para>
|
---|
| 45 | Download (HTTP): <ulink url="&wpa_supplicant-download-http;"/>
|
---|
| 46 | </para>
|
---|
[a130a69] | 47 | </listitem>
|
---|
| 48 | <listitem>
|
---|
[4c869cdd] | 49 | <para>
|
---|
| 50 | Download (FTP): <ulink url="&wpa_supplicant-download-ftp;"/>
|
---|
| 51 | </para>
|
---|
[a130a69] | 52 | </listitem>
|
---|
| 53 | <listitem>
|
---|
[4c869cdd] | 54 | <para>
|
---|
| 55 | Download MD5 sum: &wpa_supplicant-md5sum;
|
---|
| 56 | </para>
|
---|
[a130a69] | 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
[4c869cdd] | 59 | <para>
|
---|
| 60 | Download size: &wpa_supplicant-size;
|
---|
| 61 | </para>
|
---|
[a130a69] | 62 | </listitem>
|
---|
| 63 | <listitem>
|
---|
[4c869cdd] | 64 | <para>
|
---|
| 65 | Estimated disk space required: &wpa_supplicant-buildsize;
|
---|
| 66 | </para>
|
---|
[a130a69] | 67 | </listitem>
|
---|
| 68 | <listitem>
|
---|
[4c869cdd] | 69 | <para>
|
---|
| 70 | Estimated build time: &wpa_supplicant-time;
|
---|
| 71 | </para>
|
---|
[a130a69] | 72 | </listitem>
|
---|
| 73 | </itemizedlist>
|
---|
[7b4961f] | 74 |
|
---|
[4c869cdd] | 75 | <bridgehead renderas="sect3">WPA Supplicant Dependencies</bridgehead>
|
---|
| 76 |
|
---|
[ca66edf] | 77 | <bridgehead renderas="sect4">Required (Runtime)</bridgehead>
|
---|
| 78 | <para role="nodump">
|
---|
| 79 | <xref linkend="wireless-kernel"/>
|
---|
| 80 | </para>
|
---|
| 81 |
|
---|
[4c869cdd] | 82 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
| 83 | <para role="recommended">
|
---|
[4584c7b] | 84 | <xref linkend="desktop-file-utils"/> (for running
|
---|
| 85 | <command>update-desktop-database</command>) and
|
---|
| 86 | <xref linkend="libnl"/>
|
---|
[4c869cdd] | 87 | </para>
|
---|
[a130a69] | 88 |
|
---|
| 89 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[26c1bdd] | 90 | <para role="optional">
|
---|
[cea7f479] | 91 | <phrase revision="sysv"><xref linkend="dbus"/>,</phrase>
|
---|
[54666831] | 92 | <xref linkend="libxml2"/>, and
|
---|
[eb3dbe3] | 93 | <xref linkend="qt5"/>
|
---|
[26c1bdd] | 94 | </para>
|
---|
[a130a69] | 95 |
|
---|
| 96 | <para condition="html" role="usernotes">User Notes:
|
---|
[4c869cdd] | 97 | <ulink url="&blfs-wiki;/wpa_supplicant"/>
|
---|
| 98 | </para>
|
---|
[8fa167c] | 99 |
|
---|
[a130a69] | 100 | </sect2>
|
---|
| 101 |
|
---|
| 102 | <sect2 role="kernel" id="wpa_supplicant-kernel">
|
---|
| 103 | <title>Kernel Configuration</title>
|
---|
| 104 |
|
---|
[4c869cdd] | 105 | <para>
|
---|
[ca66edf] | 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.
|
---|
[4c869cdd] | 109 | </para>
|
---|
[a130a69] | 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">
|
---|
[4c869cdd] | 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>
|
---|
[a130a69] | 127 |
|
---|
[4c869cdd] | 128 | <screen><userinput>cat > wpa_supplicant/.config << "EOF"
|
---|
[8fa167c] | 129 | <literal>CONFIG_BACKEND=file
|
---|
[4c869cdd] | 130 | CONFIG_CTRL_IFACE=y
|
---|
[8cce479c] | 131 | CONFIG_DEBUG_FILE=y
|
---|
| 132 | CONFIG_DEBUG_SYSLOG=y
|
---|
| 133 | CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON
|
---|
[4c869cdd] | 134 | CONFIG_DRIVER_NL80211=y
|
---|
[a130a69] | 135 | CONFIG_DRIVER_WEXT=y
|
---|
[4c869cdd] | 136 | CONFIG_DRIVER_WIRED=y
|
---|
[a130a69] | 137 | CONFIG_EAP_GTC=y
|
---|
| 138 | CONFIG_EAP_LEAP=y
|
---|
| 139 | CONFIG_EAP_MD5=y
|
---|
| 140 | CONFIG_EAP_MSCHAPV2=y
|
---|
| 141 | CONFIG_EAP_OTP=y
|
---|
| 142 | CONFIG_EAP_PEAP=y
|
---|
| 143 | CONFIG_EAP_TLS=y
|
---|
| 144 | CONFIG_EAP_TTLS=y
|
---|
[4c869cdd] | 145 | CONFIG_IEEE8021X_EAPOL=y
|
---|
| 146 | CONFIG_IPV6=y
|
---|
| 147 | CONFIG_LIBNL32=y
|
---|
[a130a69] | 148 | CONFIG_PEERKEY=y
|
---|
| 149 | CONFIG_PKCS12=y
|
---|
| 150 | CONFIG_READLINE=y
|
---|
[4c869cdd] | 151 | CONFIG_SMARTCARD=y
|
---|
| 152 | CONFIG_WPS=y
|
---|
[8fa167c] | 153 | CFLAGS += -I/usr/include/libnl3</literal>
|
---|
[4c869cdd] | 154 | EOF</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
|
---|
[54666831] | 159 | <xref linkend="dbus"/> and <xref linkend="libxml2"/>, then add the
|
---|
[4c869cdd] | 160 | following options to the <application>WPA Supplicant</application>
|
---|
| 161 | build configuration file by running the following command:
|
---|
| 162 | </para>
|
---|
[26c1bdd] | 163 |
|
---|
[4c869cdd] | 164 | <screen><userinput>cat >> wpa_supplicant/.config << "EOF"
|
---|
[8fa167c] | 165 | <literal>CONFIG_CTRL_IFACE_DBUS=y
|
---|
[4c869cdd] | 166 | CONFIG_CTRL_IFACE_DBUS_NEW=y
|
---|
[8fa167c] | 167 | CONFIG_CTRL_IFACE_DBUS_INTRO=y</literal>
|
---|
[4c869cdd] | 168 | EOF</userinput></screen>
|
---|
[a130a69] | 169 |
|
---|
[abf53e1] | 170 | <screen><userinput>cd wpa_supplicant &&
|
---|
[ef044424] | 171 | make BINDIR=/usr/sbin LIBDIR=/usr/lib</userinput></screen>
|
---|
[a130a69] | 172 |
|
---|
[8cce479c] | 173 | <para>
|
---|
[eb3dbe3] | 174 | If you have installed <xref linkend="qt5"/> and wish to build
|
---|
[2946338a] | 175 | the <application>WPA Supplicant</application> GUI program, run
|
---|
[8cce479c] | 176 | the following commands:
|
---|
| 177 | </para>
|
---|
| 178 |
|
---|
[b51fe6e] | 179 | <note>
|
---|
| 180 | <para>
|
---|
[8558044] | 181 | The following directory name is labelled qt4, but
|
---|
[b51fe6e] | 182 | is compatible with <xref linkend="qt5"/>.
|
---|
| 183 | </para>
|
---|
| 184 | </note>
|
---|
[eb3dbe3] | 185 |
|
---|
[8cce479c] | 186 | <screen><userinput>pushd wpa_gui-qt4 &&
|
---|
| 187 | qmake wpa_gui.pro &&
|
---|
| 188 | make &&
|
---|
| 189 | popd</userinput></screen>
|
---|
| 190 |
|
---|
[4c869cdd] | 191 | <para>
|
---|
| 192 | This package does not come with a test suite.
|
---|
| 193 | </para>
|
---|
[a130a69] | 194 |
|
---|
[4c869cdd] | 195 | <para>
|
---|
[2946338a] | 196 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
[4c869cdd] | 197 | </para>
|
---|
[a130a69] | 198 |
|
---|
[d8d42fa] | 199 | <screen role="root"><userinput>install -v -m755 wpa_{cli,passphrase,supplicant} /usr/sbin/ &&
|
---|
[97a30d62] | 200 | install -v -m644 doc/docbook/wpa_supplicant.conf.5 /usr/share/man/man5/ &&
|
---|
| 201 | install -v -m644 doc/docbook/wpa_{cli,passphrase,supplicant}.8 /usr/share/man/man8/</userinput></screen>
|
---|
[a130a69] | 202 |
|
---|
[7b478500] | 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 |
|
---|
[0884fe0] | 209 | <screen role="root" revision="systemd"><userinput>install -v -m644 systemd/*.service /usr/lib/systemd/system/</userinput></screen>
|
---|
[7b478500] | 210 |
|
---|
[4c869cdd] | 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>
|
---|
[a130a69] | 218 |
|
---|
[66b1ff0] | 219 | <screen role="root"><userinput>install -v -m644 dbus/fi.w1.wpa_supplicant1.service \
|
---|
[97a30d62] | 220 | /usr/share/dbus-1/system-services/ &&
|
---|
[83394f2] | 221 | install -v -d -m755 /etc/dbus-1/system.d &&
|
---|
[2946338a] | 222 | install -v -m644 dbus/dbus-wpa_supplicant.conf \
|
---|
| 223 | /etc/dbus-1/system.d/wpa_supplicant.conf</userinput></screen>
|
---|
[a130a69] | 224 |
|
---|
[7b478500] | 225 | <para revision="systemd">
|
---|
| 226 | Additionally, enable the <filename>wpa_supplicant.service</filename>
|
---|
| 227 | so that <application>systemd</application> can properly activate the
|
---|
[8558044] | 228 | <application>D-Bus</application> service. Note that the
|
---|
| 229 | per-connection service and the D-Bus service cannot be enabled
|
---|
[7b478500] | 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 |
|
---|
[8cce479c] | 236 | <para>
|
---|
[2946338a] | 237 | If you have built the <application>WPA Supplicant</application> GUI
|
---|
[8cce479c] | 238 | program, install it by running the following commands as the
|
---|
| 239 | <systemitem class="username">root</systemitem> user:
|
---|
| 240 | </para>
|
---|
| 241 |
|
---|
[97a30d62] | 242 | <screen role="root"><userinput>install -v -m755 wpa_gui-qt4/wpa_gui /usr/bin/ &&
|
---|
| 243 | install -v -m644 doc/docbook/wpa_gui.8 /usr/share/man/man8/ &&
|
---|
| 244 | install -v -m644 wpa_gui-qt4/wpa_gui.desktop /usr/share/applications/ &&
|
---|
[2946338a] | 245 | install -v -m644 wpa_gui-qt4/icons/wpa_gui.svg /usr/share/pixmaps/</userinput></screen>
|
---|
[8cce479c] | 246 |
|
---|
[4c869cdd] | 247 | <note>
|
---|
| 248 | <para>
|
---|
[2946338a] | 249 | You will need to restart the system <application>D-Bus</application> daemon
|
---|
| 250 | before you can use the <application>WPA Supplicant</application>
|
---|
[325113f8] | 251 | <application>D-Bus</application> interface.
|
---|
[4c869cdd] | 252 | </para>
|
---|
| 253 | </note>
|
---|
[a130a69] | 254 |
|
---|
[2946338a] | 255 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 256 | href="../../xincludes/update-desktop-database.xml"/>
|
---|
[97a30d62] | 257 |
|
---|
[a130a69] | 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>
|
---|
[97a30d62] | 265 |
|
---|
[7b478500] | 266 | <para revision="sysv">
|
---|
[97a30d62] | 267 | <filename>/etc/sysconfig/wpa_supplicant-*.conf</filename>
|
---|
| 268 | </para>
|
---|
[a130a69] | 269 |
|
---|
[7b478500] | 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">
|
---|
[a130a69] | 275 | <primary
|
---|
[97a30d62] | 276 | sortas="e-etc-sysconfig-wpa_supplicant-star.conf">/etc/sysconfig/wpa_supplicant-*.conf</primary>
|
---|
[a130a69] | 277 | </indexterm>
|
---|
[97a30d62] | 278 |
|
---|
[7b478500] | 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 |
|
---|
[a130a69] | 284 | </sect3>
|
---|
| 285 |
|
---|
| 286 | <sect3>
|
---|
| 287 | <title>Configuration Information</title>
|
---|
| 288 |
|
---|
[4c869cdd] | 289 | <para>
|
---|
[2946338a] | 290 | To connect to an access point that uses a password, you need to put
|
---|
[7b478500] | 291 | the pre-shared key in
|
---|
[b51fe6e] | 292 | <phrase revision="sysv">
|
---|
| 293 | <filename>
|
---|
[7c56ece] | 294 | /etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</filename>.
|
---|
[b51fe6e] | 295 | </phrase>
|
---|
| 296 | <phrase revision="systemd">
|
---|
| 297 | <filename>
|
---|
[7c56ece] | 298 | /etc/wpa_supplicant/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</filename>.
|
---|
[b51fe6e] | 299 | </phrase>
|
---|
[97a30d62] | 300 | SSID is the string that the access point/router transmits to
|
---|
| 301 | identify itself. Run the following command as the
|
---|
[4c869cdd] | 302 | <systemitem class="username">root</systemitem> user:
|
---|
| 303 | </para>
|
---|
[a130a69] | 304 |
|
---|
[b51fe6e] | 305 | <screen role="nodump" revision="sysv"><userinput>wpa_passphrase <replaceable>SSID</replaceable> <replaceable>SECRET_PASSWORD</replaceable> > /etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</userinput></screen>
|
---|
[7b478500] | 306 |
|
---|
[b51fe6e] | 307 | <screen role="nodump" revision="systemd"><userinput>install -v -dm755 /etc/wpa_supplicant &&
|
---|
[7b478500] | 308 | wpa_passphrase <replaceable>SSID</replaceable> <replaceable>SECRET_PASSWORD</replaceable> > /etc/wpa_supplicant/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</userinput></screen>
|
---|
[a130a69] | 309 |
|
---|
[4c869cdd] | 310 | <para>
|
---|
[b51fe6e] | 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>
|
---|
[8558044] | 320 | </phrase>
|
---|
[7b478500] | 321 | can hold the details of several access points. When
|
---|
[97a30d62] | 322 | <command>wpa_supplicant</command> is started, it will scan for the
|
---|
| 323 | SSIDs it can see and choose the appropriate password to connect.
|
---|
[822cc4a6] | 324 | </para>
|
---|
[a130a69] | 325 |
|
---|
[4c869cdd] | 326 | <para>
|
---|
| 327 | If you want to connect to an access point that isn't password
|
---|
[7b478500] | 328 | protected, put an entry like this in
|
---|
[b51fe6e] | 329 | <phrase revision="sysv">
|
---|
| 330 | <filename>
|
---|
[7c56ece] | 331 | /etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</filename>.
|
---|
[b51fe6e] | 332 | </phrase>
|
---|
| 333 | <phrase revision="systemd">
|
---|
| 334 | <filename>
|
---|
[7c56ece] | 335 | /etc/wpa_supplicant/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</filename>.
|
---|
| 336 | </phrase>
|
---|
[97a30d62] | 337 | Replace "Some-SSID" with the SSID of the access point/router.
|
---|
[4c869cdd] | 338 | </para>
|
---|
[a130a69] | 339 |
|
---|
| 340 | <screen>network={
|
---|
| 341 | ssid="<replaceable>Some-SSID</replaceable>"
|
---|
| 342 | key_mgmt=NONE
|
---|
| 343 | }</screen>
|
---|
| 344 |
|
---|
[b51fe6e] | 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>
|
---|
[822cc4a6] | 351 |
|
---|
[f77c63d0] | 352 | <screen>ctrl_interface=DIR=/run/wpa_supplicant GROUP=<privileged group>
|
---|
[822cc4a6] | 353 | update_config=1</screen>
|
---|
| 354 |
|
---|
| 355 | <para>
|
---|
[f77c63d0] | 356 | Replace the <privileged group> above with a system group where
|
---|
[822cc4a6] | 357 | members have the ability to connect to a wireless access point.
|
---|
| 358 | </para>
|
---|
| 359 |
|
---|
[4c869cdd] | 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>
|
---|
[a130a69] | 366 |
|
---|
[97a30d62] | 367 | </sect3>
|
---|
| 368 |
|
---|
| 369 | <sect3>
|
---|
| 370 | <title>Connecting to an Access Point</title>
|
---|
| 371 |
|
---|
[7b478500] | 372 | <para id="wpa-service" revision="sysv">
|
---|
[97a30d62] | 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
|
---|
[7b478500] | 376 | included in <xref linkend="bootscripts"/> package:
|
---|
[97a30d62] | 377 | </para>
|
---|
| 378 |
|
---|
[7b478500] | 379 | <screen role="root" revision="sysv"><userinput>make install-service-wpa</userinput></screen>
|
---|
[97a30d62] | 380 |
|
---|
[7b478500] | 381 | <indexterm zone="wpa_supplicant wpa-service" revision="sysv">
|
---|
[97a30d62] | 382 | <primary sortas="f-wpa">wpa</primary>
|
---|
| 383 | </indexterm>
|
---|
| 384 |
|
---|
[7b478500] | 385 | <para revision="sysv">
|
---|
[97a30d62] | 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
|
---|
[2e41a4f] | 389 | <filename>/etc/sysconfig/ifconfig-<replaceable>wifi0</replaceable>
|
---|
[97a30d62] | 390 | </filename> by running the following command as the
|
---|
[4c869cdd] | 391 | <systemitem class="username">root</systemitem> user:
|
---|
| 392 | </para>
|
---|
[a130a69] | 393 |
|
---|
[7b478500] | 394 | <screen role="root" revision="sysv"><userinput>cat > /etc/sysconfig/ifconfig.<replaceable>wifi0</replaceable> << "EOF"
|
---|
[97a30d62] | 395 | <literal>ONBOOT="yes"
|
---|
| 396 | IFACE="<replaceable>wlan0</replaceable>"
|
---|
| 397 | SERVICE="wpa"
|
---|
[a130a69] | 398 |
|
---|
[97a30d62] | 399 | # Additional arguments to wpa_supplicant
|
---|
| 400 | WPA_ARGS=""
|
---|
| 401 |
|
---|
| 402 | WPA_SERVICE="dhclient"
|
---|
| 403 | DHCP_START=""
|
---|
| 404 | DHCP_STOP=""
|
---|
| 405 |
|
---|
| 406 | # Set PRINTIP="yes" to have the script print
|
---|
| 407 | # the DHCP assigned IP address
|
---|
| 408 | PRINTIP="no"
|
---|
| 409 |
|
---|
| 410 | # Set PRINTALL="yes" to print the DHCP assigned values for
|
---|
| 411 | # IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
|
---|
| 412 | PRINTALL="no"</literal>
|
---|
| 413 | EOF</userinput></screen>
|
---|
| 414 |
|
---|
[7b478500] | 415 | <para revision="sysv">
|
---|
[97a30d62] | 416 | If you prefer <xref linkend="dhcpcd"/> instead of
|
---|
[0d7900a] | 417 | <xref linkend="dhcp"/> client, then create the
|
---|
[2e41a4f] | 418 | <filename>/etc/sysconfig/ifconfig-<replaceable>wifi0</replaceable>
|
---|
[97a30d62] | 419 | </filename> by running the following command as the
|
---|
| 420 | <systemitem class="username">root</systemitem> user:
|
---|
| 421 | </para>
|
---|
| 422 |
|
---|
[7b478500] | 423 | <screen role="root" revision="sysv"><userinput>cat > /etc/sysconfig/ifconfig.<replaceable>wifi0</replaceable> << "EOF"
|
---|
[97a30d62] | 424 | <literal>ONBOOT="yes"
|
---|
| 425 | IFACE="<replaceable>wlan0</replaceable>"
|
---|
| 426 | SERVICE="wpa"
|
---|
| 427 |
|
---|
| 428 | # Additional arguments to wpa_supplicant
|
---|
| 429 | WPA_ARGS=""
|
---|
| 430 |
|
---|
| 431 | WPA_SERVICE="dhcpcd"
|
---|
| 432 | DHCP_START="-b -q <replaceable><insert appropriate start options here></replaceable>"
|
---|
| 433 | DHCP_STOP="-k <replaceable><insert additional stop options here></replaceable>"</literal>
|
---|
| 434 | EOF</userinput></screen>
|
---|
[a130a69] | 435 |
|
---|
[7b478500] | 436 | <para revision="sysv">
|
---|
[97a30d62] | 437 | Alternatively, if you use static addresses on your local network,
|
---|
| 438 | then create the
|
---|
[2e41a4f] | 439 | <filename>/etc/sysconfig/ifconfig-<replaceable>wifi0</replaceable>
|
---|
[97a30d62] | 440 | </filename> by running the following command as the
|
---|
[4c869cdd] | 441 | <systemitem class="username">root</systemitem> user:
|
---|
| 442 | </para>
|
---|
[a130a69] | 443 |
|
---|
[7b478500] | 444 | <screen role="root" revision="sysv"><userinput>cat > /etc/sysconfig/ifconfig.<replaceable>wifi0</replaceable> << "EOF"
|
---|
[97a30d62] | 445 | <literal>ONBOOT="yes"
|
---|
| 446 | IFACE="<replaceable>wlan0</replaceable>"
|
---|
| 447 | SERVICE="wpa"
|
---|
| 448 |
|
---|
| 449 | # Additional arguments to wpa_supplicant
|
---|
| 450 | WPA_ARGS=""
|
---|
| 451 |
|
---|
| 452 | WPA_SERVICE="ipv4-static"
|
---|
| 453 | IP="192.168.1.1"
|
---|
| 454 | GATEWAY="192.168.1.2"
|
---|
| 455 | PREFIX="24"
|
---|
| 456 | BROADCAST="192.168.1.255"</literal>
|
---|
| 457 | EOF</userinput></screen>
|
---|
[a130a69] | 458 |
|
---|
[7b478500] | 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 |
|
---|
[4c869cdd] | 489 | <para>
|
---|
[97a30d62] | 490 | You can connect to the wireless access point by
|
---|
| 491 | running the following command as the
|
---|
[4c869cdd] | 492 | <systemitem class="username">root</systemitem> user:
|
---|
| 493 | </para>
|
---|
[a130a69] | 494 |
|
---|
[7b478500] | 495 | <screen role="root" revision="sysv"><userinput>ifup <replaceable>wifi0</replaceable></userinput></screen>
|
---|
[97a30d62] | 496 |
|
---|
[7b478500] | 497 | <para revision="sysv">
|
---|
[97a30d62] | 498 | Replace <replaceable>wlan0</replaceable> with the correct
|
---|
[2e41a4f] | 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.
|
---|
[97a30d62] | 505 | </para>
|
---|
[a130a69] | 506 |
|
---|
[7b478500] | 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
|
---|
[f0dc9578] | 527 | <ulink url="&lfs-root;/chapter09/network.html">General Network Configuration</ulink>
|
---|
[7b478500] | 528 | page in LFS.
|
---|
| 529 | </para>
|
---|
| 530 |
|
---|
[a130a69] | 531 | </sect3>
|
---|
[97a30d62] | 532 |
|
---|
[a130a69] | 533 | </sect2>
|
---|
| 534 |
|
---|
| 535 | <sect2 role="content">
|
---|
| 536 | <title>Contents</title>
|
---|
| 537 |
|
---|
| 538 | <segmentedlist>
|
---|
| 539 | <segtitle>Installed Programs</segtitle>
|
---|
[c3c56b2] | 540 | <segtitle>Installed Libraries</segtitle>
|
---|
| 541 | <segtitle>Installed Directories</segtitle>
|
---|
[0d7900a] | 542 |
|
---|
[a130a69] | 543 | <seglistitem>
|
---|
[8cce479c] | 544 | <seg>
|
---|
| 545 | wpa_gui, wpa_supplicant, wpa_passphrase and wpa_cli
|
---|
| 546 | </seg>
|
---|
[c3c56b2] | 547 | <seg>
|
---|
| 548 | None
|
---|
| 549 | </seg>
|
---|
| 550 | <seg>
|
---|
| 551 | None
|
---|
| 552 | </seg>
|
---|
[a130a69] | 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 |
|
---|
[8cce479c] | 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
|
---|
[4c24eb0a] | 566 | <application>wpa_supplicant</application>
|
---|
[8cce479c] | 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 |
|
---|
[a130a69] | 574 | <varlistentry id="wpa_supplicant-prog">
|
---|
| 575 | <term><command>wpa_supplicant</command></term>
|
---|
| 576 | <listitem>
|
---|
[4c869cdd] | 577 | <para>
|
---|
| 578 | is a daemon that can connect to a password protected wireless
|
---|
[4c24eb0a] | 579 | access point
|
---|
[4c869cdd] | 580 | </para>
|
---|
[a130a69] | 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>
|
---|
[4c869cdd] | 590 | <para>
|
---|
| 591 | takes an SSID and a password and generates a simple
|
---|
| 592 | configuration that <command>wpa_supplicant</command> can
|
---|
[4c24eb0a] | 593 | understand
|
---|
[4c869cdd] | 594 | </para>
|
---|
[a130a69] | 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>
|
---|
[4c869cdd] | 604 | <para>
|
---|
| 605 | is a command line interface used to control a running
|
---|
[4c24eb0a] | 606 | <command>wpa_supplicant</command> daemon
|
---|
[4c869cdd] | 607 | </para>
|
---|
[a130a69] | 608 | <indexterm zone="wpa_supplicant wpa_cli">
|
---|
| 609 | <primary sortas="b-wpa_cli">wpa_cli</primary>
|
---|
| 610 | </indexterm>
|
---|
| 611 | </listitem>
|
---|
| 612 | </varlistentry>
|
---|
[4c869cdd] | 613 |
|
---|
[a130a69] | 614 | </variablelist>
|
---|
[4c869cdd] | 615 |
|
---|
[a130a69] | 616 | </sect2>
|
---|
[4c869cdd] | 617 |
|
---|
[a130a69] | 618 | </sect1>
|
---|