Changeset 1079

Show
Ignore:
Timestamp:
08/09/07 03:39:20 (1 year ago)
Author:
robert
Message:

Updated wpa-service hint

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wpa-service.txt

    r1074 r1079  
    88services 
    99 
     10PRIMARY URL: 
     11http://www.bliscat.org/bliscat/hints/wpa-service/wpa-service-0.24.tar.bz2 
     12 
    1013DESCRIPTION: 
    11  
     14        This hint explains how to set a network service using wpa_supplicant 
    1215ATTACHMENTS: 
    1316 
    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  
     17http://www.linuxfromscratch.org/hints/downloads/files/ATTACHMENTS/wpa-service/wpa-service-0.24.tar.bz2 
    2018 
    2119PREREQUISITES: 
    2220 
    23 - A working LFS-6.1.1 system or newer with wireless capabilities   
     21- A working LFS-6.2 system or newer with wireless capabilities   
    2422- Almost two networks services like ipv4-static/dhcpcd installed 
    2523- wpa_supplicant (>=0.5.7) and wireless drivers 
     
    32300.a) wpa_supplicant 'The core' 
    3331~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    34 This is NOT an usual step if you omit something here you won't be able 
    35 to attach 
     32This is NOT an usual step if you omit something here you won't be able to attach 
    3633your device to any access point 
    3734 
     
    3936link: http://hostap.epitest.fi/wpa_supplicant 
    4037 
    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 
     38Again, i strongly recommend you to read its README before doing anything. 
     39wpa_supplicant may need the source of your drivers then edit the .config file 
     40as described in the README and set all constants according to your system. 
     41Also when ready install it by executing : 
     42 
     43        make prefix=/usr && 
     44        make install 
    5245 
    53461) This Hints 
    5447~~~~~~~~~~~~~ 
    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. 
     48Well ... 
     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" 
     51but this, nobody cares... 
     52 
     53 
    6054 
    61551.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~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     57Extract wpa-service-0.24.tar.bz2 and in the extracted directory and run the 
     58following commands: 
     59 
     60OPION 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 
    7880 
    7981  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 
     87OPTION 2: same as above but in a script 
     88        ./install.sh <IFACE> 
     89 
     902) Configuration 
     91~~~~~~~~~~~~~~~~ 
     92 
     93Network configuration go in the wpa-service-iface 
     94which is located at /etc/sysconfig/network-device/ifconfig.<IFACE>/wpa-service 
     95 
     96WPA/WEP keys go in netkey 
     97which is located at /etc/sysconfig/network.d/netkey 
    9198 
    9299  
    93 2.1) Network configurations with any of the three functions
    94 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     1002.1) Network configurations (IP)
     101~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    95102 
    96103wpa-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 
     104that if the SSID "DHCP network" manage ip via a dhcp server, wpa-service will 
     105use the SSID file descriptor to set up you network when connecting to the SSID 
    101106network. 
    102107 
    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 
     108Those ssid descriptors are named with the name of the SSID they describe, 
     109and took place in the /etc/sysconfig/network.d directory. 
     110 
     111The "AzErTy" SSID descriptor will be /etc/sysconfig/network.d/AzeRtY 
     112 
     1132.1.1) SSID descriptor syntax: 
     114~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     115 
     116An SSID descriptor is a regular network configuration file as used in LFS BOOK. 
     117it means that if SSID "IPV4" use ipv4-static, the the descriptor "IPV4" will be 
    115118 
    116119        cat > /etc/sysconfig/network.d/IPV4 << "EOF" 
     
    129132        SERVICE="dhcpcd" 
    130133        DHCP_START="-o" 
    131         DHCP_STOP="-k -o" # the '-o' prevent your interface being destroyed by 
    132 dhcpcd  
     134        DHCP_STOP="-k -o" 
     135       # the '-o' prevent your interface being destroyed by dhcpcd  
    133136 
    134137        # Set PRINTIP="yes" to have the script print 
     
    141144        EOF 
    142145 
    143 for convenience, wpa_actions fall back 
    144 to /etc/sysconfig/network.d/AUTO 
    145 when no SSID descriptor is available, 
     146for convenience, wpa_actions fall back to /etc/sysconfig/network.d/AUTO when 
     147no SSID descriptor is available. 
    146148 
    147149Then install a common/automatic network configuration: 
     
    152154        SERVICE="dhcpcd" 
    153155        DHCP_START="-o" 
    154         DHCP_STOP="-k -o" # the '-o' prevent your interface being destroyed by 
    155 dhcpcd 
     156        DHCP_STOP="-k -o" 
     157       # the '-o' prevent your interface being destroyed by dhcpcd 
    156158 
    157159        # Set PRINTIP="yes" to have the script print 
     
    164166        EOF 
    165167 
    166  
    167 (this files can be symlinked, to prevent duplication) 
    168  
    169 3) The wpa_supplicant.conf (The network keys description)  
    170 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     1683) The netkey file (The network keys description)  
     169~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     170 
     171This file was previously named wpa_supplicant.conf 
     172but because i will only use it to store WPA/WEP key, i renamed it netkey and 
     173moved it to /etc/sysconfig/network.d/netkey 
    171174 
    172175The wpa_supplicant README and wiki explain the composition of this file. 
    173176 
    174177The 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. 
     178to the wpa_supplicant program and only depends of the programmer choice, thus 
     179instead of explaining you of how this file is read, i will show you a set of 
     180command to create a config file with wpa_supplicant. 
    181181 
    182182in a bash shell execute: 
    183183 
    184 wpa_passphrase <ssid> [passphrase] >> wpa_supplicant.conf 
     184wpa_passphrase <ssid> [passphrase] >> /etc/sysconfig/network.d/netkey 
    185185 
    186186Where <ssid> is the name of the access point and where [pasphrase] is 
     
    188188pass-phrase. 
    189189 
    190 Now edit the newly created wpa_supplicant.conf file: 
     190Now edit the newly created netkey file: 
    191191Which should contains something similar to: 
    192192 
     
    194194        ssid="ssid" 
    195195        #psk="passphrase" 
    196  
    197 psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726 
     196        psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726 
    198197} 
    199198 
    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. 
     199You will directly see that you can define more than one network in this 
     200file, that's why wpa_supplicant is very nice: it chooses automatically in its 
     201configuration file the best (aka secure and available) network to connect. 
    205202 
    2062034) Geting over troubles (and tunning your network) 
     
    247244 
    248245As an example: 
    249  
    250246 
    251247root at bliscat:/home/eloi# wpa_cli -iath0 -p/var/run/wpa_supplicant 
     
    279275 
    280276 
    281 With this output we can now feed the wpa_supplicant.conf file: 
     277With this output we can now feed the netkey file: 
    282278 
    283279network={ 
     
    288284        group=CCMP 
    289285        #psk="passphrase" 
    290  
    291 psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726 
     286        psk=2b1d17284c54aeaeeaae7151290e9744af2182b0eb8af20dd4ebb415928f726 
    292287} 
    293288 
     
    305300 
    306301example: 
    307 wpa_supplicant -dmadwifi -iath0 -c./wpa_supplicant.conf -dd 
     302wpa_supplicant -dmadwifi -iath0 -c./netkey -dd 
    308303 
    309304If you see something like SUCCESS it's done, kill it again and copy the 
     
    311306file to a secure directory: 
    312307 
    313 install -d /etc/sysconfig/wpa_supplicant 
    314 chmod 700 -c /etc/sysconfig/wpa_supplicant 
    315 cp wpa_supplicant.conf /etc/sysconfig/wpa_supplicant/wpa_supplicant.conf 
    316 chmod 600 -c /etc/sysconfig/wpa_supplicant/wpa_supplicant.conf 
     308install -d /etc/sysconfig/network.d 
     309chmod 700 -v /etc/sysconfig/network.d 
     310cp netkey /etc/sysconfig/network.d 
     311chmod 600 -v /etc/sysconfig/network.d/netkey 
    317312 
    318313 
     
    322317 
    323318/etc/rc.d/init.d/network stop 
    324 /etc/rc.d./init.d/wpa restart 
     319/etc/rc.d./init.d/wpa-service restart 
    325320/etc/rc.d/init.d/network start 
    326321 
     
    339334CHANGELOG: 
    3403352006 03 10 Second release, first send to lfshint 
    341 2006 03 16 added some words to help wpa-supplicant.conf writing 
     3362006 03 16 added some words to help wpa_supplicant.conf writing 
    3423372006 03 18 fix wrong paths 
    3433382006 03 31 Rewritten and try to match the LFS-standard thank's to 
     
    350345        this modifiy wpa_actions and wpa_service.conf 
    351346        NETWORKDIR and SERVICESDIR moved to wpa_service.conf 
    352  
     347        version increment to 0.22 
     3482007 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 
     3532007 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