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