Changeset 1079
- Timestamp:
- 08/09/07 03:39:20 (1 year ago)
- Files:
-
- trunk/wpa-service.txt (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wpa-service.txt
r1074 r1079 8 8 services 9 9 10 PRIMARY URL: 11 http://www.bliscat.org/bliscat/hints/wpa-service/wpa-service-0.24.tar.bz2 12 10 13 DESCRIPTION: 11 14 This hint explains how to set a network service using wpa_supplicant 12 15 ATTACHMENTS: 13 16 14 http://www.linuxfromscratch.org/hints/downloads/files/ATTACHMENTS/wpa-service/wpa_service.conf 15 http://www.linuxfromscratch.org/hints/downloads/files/ATTACHMENTS/wpa-service/wpa-rcscript 16 http://www.linuxfromscratch.org/hints/downloads/files/ATTACHMENTS/wpa-service/wpa-service 17 http://www.linuxfromscratch.org/hints/downloads/files/ATTACHMENTS/wpa-service/wpa-service-iface 18 http://www.linuxfromscratch.org/hints/downloads/files/ATTACHMENTS/wpa-service/wpa_actions-script 19 17 http://www.linuxfromscratch.org/hints/downloads/files/ATTACHMENTS/wpa-service/wpa-service-0.24.tar.bz2 20 18 21 19 PREREQUISITES: 22 20 23 - A working LFS-6. 1.1system or newer with wireless capabilities21 - A working LFS-6.2 system or newer with wireless capabilities 24 22 - Almost two networks services like ipv4-static/dhcpcd installed 25 23 - wpa_supplicant (>=0.5.7) and wireless drivers … … 32 30 0.a) wpa_supplicant 'The core' 33 31 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 34 This is NOT an usual step if you omit something here you won't be able 35 to attach 32 This is NOT an usual step if you omit something here you won't be able to attach 36 33 your device to any access point 37 34 … … 39 36 link: http://hostap.epitest.fi/wpa_supplicant 40 37 41 Again, i strongly recommend you to read its README before doing 42 anything. 43 wpa_supplicant may need the source of your drivers then edit the .config 44 file 45 as described in the README and set all constants according to your 46 system. 47 also when ready install it by executing : 48 49 find ./ -name 'Makefile' -exec sed 's,/usr/local,/usr,g' {} \; && 50 make && 51 make install 38 Again, i strongly recommend you to read its README before doing anything. 39 wpa_supplicant may need the source of your drivers then edit the .config file 40 as described in the README and set all constants according to your system. 41 Also when ready install it by executing : 42 43 make prefix=/usr && 44 make install 52 45 53 46 1) This Hints 54 47 ~~~~~~~~~~~~~ 55 wpa_supplicant is designed to be a "daemon" program that runs in the 56 background 57 and acts as the back-end component controlling the wireless connection. 58 wpa_supplicant supports separate front-end programs and a text-based 59 front-end (wpa_cli) is included with wpa_supplicant. 48 Well ... 49 "wpa-service is a back-end lfs-like service using the front-end wpa_cli of 50 (breath here) the back-end componment wpa_supplicant on lfs based systems" 51 but this, nobody cares... 52 53 60 54 61 55 1.1) Install Files and Directories (this is only a proposal) 62 63 install -d /etc/sysconfig/wpa_supplicant 64 install -d /etc/sysconfig/network.d 65 install -m644 wpa_service.conf /etc/sysconfig/wpa_supplicant 66 67 install -m755 wpa-rcscript /etc/rc.d/init.d/wpa 68 ln -nsf /etc/rc.d/init.d/wpa /etc/rc.d/rc3.d/S15wpa 69 ln -nsf /etc/rc.d/init.d/wpa /etc/rc.d/rc5.d/S15wpa 70 ln -nsf /etc/rc.d/init.d/wpa /etc/rc.d/rc6.d/K85wpa 71 ln -nsf /etc/rc.d/init.d/wpa /etc/rc.d/rc0.d/K85wpa 72 73 install -m755 74 wpa_actions-script /etc/sysconfig/wpa_supplicant/wpa_actions 75 install -m755 76 ifplugd_wrapper-script /etc/sysconfig/wpa_supplicant/ifplugd_wrapper 77 install -m755 wpa-service /etc/sysconfig/network-devices/services 56 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 57 Extract wpa-service-0.24.tar.bz2 and in the extracted directory and run the 58 following commands: 59 60 OPION 1 : 61 62 install -dv -m 700 /etc/sysconfig/network.d 63 install -dv /etc/sysconfig/wpa-service 64 install -dv /etc/sysconfig/network-devices/services 65 install -dv /usr/share/doc/wpa-service 66 67 touch /etc/sysconfig/network.d/netkey 68 chmod -v 600 /etc/sysconfig/wpa-service/netkey 69 install -v -m644 wpa-service-conf /etc/sysconfig/wpa-service/wpa-service.conf 70 install -v -m754 wpa-action-script /etc/sysconfig/wpa-service/wpa-actions 71 install -v -m644 wpa-service.txt /usr/share/doc/wpa-service 72 install -v -m644 wpa-service-iface /usr/share/doc/wpa-service 73 install -v -m755 wpa-service /etc/sysconfig/network-devices/services 74 75 install -m755 wpa-service-rcscript /etc/rc.d/init.d/wpa-service 76 ln -nsf /etc/rc.d/init.d/wpa-service /etc/rc.d/rc3.d/S15wpa-service 77 ln -nsf /etc/rc.d/init.d/wpa-service /etc/rc.d/rc5.d/S15wpa-service 78 ln -nsf /etc/rc.d/init.d/wpa-service /etc/rc.d/rc6.d/K85wpa-service 79 ln -nsf /etc/rc.d/init.d/wpa-service /etc/rc.d/rc0.d/K85wpa-service 78 80 79 81 install -d /etc/sysconfig/network-devices/ifconfig.<IFACE> 80 install -m644 81 wpa-service-iface /etc/sysconfig/network-devices/ifconfig.<IFACE>/wpa-service 82 83 were <IFACE> is your interface 84 85 2) Network Configuration 86 ~~~~~~~~~~~~~~~~~~~~~~~~ 87 88 All configurations go in the wpa-service-iface 89 which is located 90 at /etc/sysconfig/network-device/ifconfig.<IFACE>/wpa-service 82 install -v -m644 wpa-service-iface \ 83 /etc/sysconfig/network-devices/ifconfig.<IFACE>/wpa-service 84 85 where <IFACE> is your interface 86 87 OPTION 2: same as above but in a script 88 ./install.sh <IFACE> 89 90 2) Configuration 91 ~~~~~~~~~~~~~~~~ 92 93 Network configuration go in the wpa-service-iface 94 which is located at /etc/sysconfig/network-device/ifconfig.<IFACE>/wpa-service 95 96 WPA/WEP keys go in netkey 97 which is located at /etc/sysconfig/network.d/netkey 91 98 92 99 93 2.1) Network configurations with any of the three functions:94 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~100 2.1) Network configurations (IP): 101 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 95 102 96 103 wpa-service can set up your network according to it's SSID, this means 97 that if 98 the SSID "DHCP network" manage ip via a dhcp server, wpa-service will 99 use the 100 SSID file descriptor to set up you network when connecting to the SSID 104 that if the SSID "DHCP network" manage ip via a dhcp server, wpa-service will 105 use the SSID file descriptor to set up you network when connecting to the SSID 101 106 network. 102 107 103 Those ssid descriptors are named with the name of the SSID they 104 describe, 105 and took place in the /etc/sysconfig/network.d directory. 106 107 the "AzErTy" SSID descriptor will 108 be /etc/sysconfig/network.d/AzeRtY 109 110 2.1) SSID descriptor syntax: 111 An SSID descriptor is a regular network configuration file as used in 112 LFS system 113 it means that if SSID "IPV4" use ipv4-static, the the descriptor "IPV4" 114 will be 108 Those ssid descriptors are named with the name of the SSID they describe, 109 and took place in the /etc/sysconfig/network.d directory. 110 111 The "AzErTy" SSID descriptor will be /etc/sysconfig/network.d/AzeRtY 112 113 2.1.1) SSID descriptor syntax: 114 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 115 116 An SSID descriptor is a regular network configuration file as used in LFS BOOK. 117 it means that if SSID "IPV4" use ipv4-static, the the descriptor "IPV4" will be 115 118 116 119 cat > /etc/sysconfig/network.d/IPV4 << "EOF" … … 129 132 SERVICE="dhcpcd" 130 133 DHCP_START="-o" 131 DHCP_STOP="-k -o" # the '-o' prevent your interface being destroyed by132 dhcpcd134 DHCP_STOP="-k -o" 135 # the '-o' prevent your interface being destroyed by dhcpcd 133 136 134 137 # Set PRINTIP="yes" to have the script print … … 141 144 EOF 142 145 143 for convenience, wpa_actions fall back 144 to /etc/sysconfig/network.d/AUTO 145 when no SSID descriptor is available, 146 for convenience, wpa_actions fall back to /etc/sysconfig/network.d/AUTO when 147 no SSID descriptor is available. 146 148 147 149 Then install a common/automatic network configuration: … … 152 154 SERVICE="dhcpcd" 153 155 DHCP_START="-o" 154 DHCP_STOP="-k -o" # the '-o' prevent your interface being destroyed by155 dhcpcd156 DHCP_STOP="-k -o" 157 # the '-o' prevent your interface being destroyed by dhcpcd 156 158 157 159 # Set PRINTIP="yes" to have the script print … … 164 166 EOF 165 167 166 167 (this files can be symlinked, to prevent duplication) 168 169 3) The wpa_supplicant.conf (The network keys description) 170 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 168 3) The netkey file (The network keys description) 169 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 170 171 This file was previously named wpa_supplicant.conf 172 but because i will only use it to store WPA/WEP key, i renamed it netkey and 173 moved it to /etc/sysconfig/network.d/netkey 171 174 172 175 The wpa_supplicant README and wiki explain the composition of this file. 173 176 174 177 The file syntax is the wpa_supplicant.conf file syntax, it is specific 175 to the 176 wpa_supplicant program and only depend of the programmer choice, thus 177 instead of 178 explaining you of how this file is read, i will show you a set of 179 command to 180 create a config file with wpa_supplicant. 178 to the wpa_supplicant program and only depends of the programmer choice, thus 179 instead of explaining you of how this file is read, i will show you a set of 180 command to create a config file with wpa_supplicant. 181 181 182 182 in a bash shell execute: 183 183 184 wpa_passphrase <ssid> [passphrase] >> wpa_supplicant.conf184 wpa_passphrase <ssid> [passphrase] >> /etc/sysconfig/network.d/netkey 185 185 186 186 Where <ssid> is the name of the access point and where [pasphrase] is … … 188 188 pass-phrase. 189 189 190 Now edit the newly created wpa_supplicant.conffile:190 Now edit the newly created netkey file: 191 191 Which should contains something similar to: 192 192 … … 194 194 ssid="ssid" 195 195 #psk="passphrase" 196 197 psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726 196 psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726 198 197 } 199 198 200 you will directly see that you can define more than one network in this 201 file, 202 that's why wpa_supplicant is very nice: it chooses automatically in its 203 configuration file the best (aka secure and available) network to 204 connect. 199 You will directly see that you can define more than one network in this 200 file, that's why wpa_supplicant is very nice: it chooses automatically in its 201 configuration file the best (aka secure and available) network to connect. 205 202 206 203 4) Geting over troubles (and tunning your network) … … 247 244 248 245 As an example: 249 250 246 251 247 root at bliscat:/home/eloi# wpa_cli -iath0 -p/var/run/wpa_supplicant … … 279 275 280 276 281 With this output we can now feed the wpa_supplicant.conffile:277 With this output we can now feed the netkey file: 282 278 283 279 network={ … … 288 284 group=CCMP 289 285 #psk="passphrase" 290 291 psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726 286 psk=2b1d17284c54aeaeeaae7151290e9744af2182b0eb8af20dd4ebb415928f726 292 287 } 293 288 … … 305 300 306 301 example: 307 wpa_supplicant -dmadwifi -iath0 -c./ wpa_supplicant.conf-dd302 wpa_supplicant -dmadwifi -iath0 -c./netkey -dd 308 303 309 304 If you see something like SUCCESS it's done, kill it again and copy the … … 311 306 file to a secure directory: 312 307 313 install -d /etc/sysconfig/ wpa_supplicant314 chmod 700 - c /etc/sysconfig/wpa_supplicant315 cp wpa_supplicant.conf /etc/sysconfig/wpa_supplicant/wpa_supplicant.conf316 chmod 600 - c /etc/sysconfig/wpa_supplicant/wpa_supplicant.conf308 install -d /etc/sysconfig/network.d 309 chmod 700 -v /etc/sysconfig/network.d 310 cp netkey /etc/sysconfig/network.d 311 chmod 600 -v /etc/sysconfig/network.d/netkey 317 312 318 313 … … 322 317 323 318 /etc/rc.d/init.d/network stop 324 /etc/rc.d./init.d/wpa restart319 /etc/rc.d./init.d/wpa-service restart 325 320 /etc/rc.d/init.d/network start 326 321 … … 339 334 CHANGELOG: 340 335 2006 03 10 Second release, first send to lfshint 341 2006 03 16 added some words to help wpa -supplicant.conf writing336 2006 03 16 added some words to help wpa_supplicant.conf writing 342 337 2006 03 18 fix wrong paths 343 338 2006 03 31 Rewritten and try to match the LFS-standard thank's to … … 350 345 this modifiy wpa_actions and wpa_service.conf 351 346 NETWORKDIR and SERVICESDIR moved to wpa_service.conf 352 347 version increment to 0.22 348 2007 03 27 added missing installation of wpa-service.conf file 349 rename wpa_service.conf to wpa-service.conf 350 this modify all scripts and the core service script 351 remove line dealing with the install of an ifplugd script 352 version increment to 0.23 353 2007 06 14 wpa_supplicant.conf renamed to netkey and moved to network.d 354 netkey chmoded to 600 355 wpa-service and network.d to 700 356 wpa-rcscript: renamed to wpa-service-rcscript 357 wpa-service-rcscript: updated 358 wpa-service: removed unused wait_for_up function 359 '&> /dev/null' replaced by '2>&1 /dev/null' 360 WPA_CONFIG_FILE is now WPA_KEY_FILE 361 WPA_CONFIG_DIR is now WPA_KEY_DIR 362 wpa-service-conf: updated (to follow wpa-* change) 363 wpa_action-script: renamed to wpa-action-script 364 hint updated and files are now shipped in a tarball 365 with a very basic install.sh script 366 typo fix in hint 367 version increment to 0.24
