r1027 - in trunk: . ATTACHMENTS ATTACHMENTS/wpa-service OLD

archaic at linuxfromscratch.org archaic at linuxfromscratch.org
Sun Apr 2 09:25:04 PDT 2006


Author: archaic
Date: 2006-04-02 10:25:03 -0600 (Sun, 02 Apr 2006)
New Revision: 1027

Added:
   trunk/ATTACHMENTS/wpa-service/
   trunk/ATTACHMENTS/wpa-service/autoipd-service
   trunk/ATTACHMENTS/wpa-service/wpa-init
   trunk/ATTACHMENTS/wpa-service/wpa-service
   trunk/ATTACHMENTS/wpa-service/wpa-service-conf
   trunk/OLD/wpa-dhcpcd.txt
   trunk/wpa-service
Removed:
   trunk/wpa-dhcpcd.txt
Log:
Added wpa-service.txt (supercedes wpa-dhcpcd.txt by the same author).

Added: trunk/ATTACHMENTS/wpa-service/autoipd-service
===================================================================
--- trunk/ATTACHMENTS/wpa-service/autoipd-service	                        (rev 0)
+++ trunk/ATTACHMENTS/wpa-service/autoipd-service	2006-04-02 16:25:03 UTC (rev 1027)
@@ -0,0 +1,68 @@
+#!/bin/sh
+# Begin $network-devices/services/autoipd-service
+
+# Based upon lfs-bootscripts-1.12 $network_devices/if{down,up}
+# Rewritten by Nathan Coulson <nathan at linuxfromscratch.org>
+# Adapted for autoipd by Eloi Primaux <eloi AT bliscat DOT org>
+
+#$LastChangedBy: eloi $
+#$Date: 2006-03-31 19:48:55 -0300 (Fri, 31 Mar 2006) $
+
+. /etc/sysconfig/rc
+. $rc_functions
+. $IFCONFIG
+
+
+
+
+#Options:
+
+#-h          this help
+#-v          display version information
+#-d          run in debug mode
+#-i ifname   use interface ifname
+#-s addr     start at IP address addr
+#-m addr     use this mac address
+
+PIDFILE="/var/run/autoipd-$1.pid"
+
+case "$2" in
+        up)
+                boot_mesg -n "Starting autoipd on the $1 interface..."
+                # Test to see if there is a stale pid file
+                if [ -f "$PIDFILE" ]
+                then
+                    ps `cat "$PIDFILE"` | grep autoipd > /dev/null
+                    if [ $? != 0 ]
+                    then
+                        rm -f /var/run/autoipd-$1.pid > /dev/null
+                    else
+			boot_mesg "autoipd already running!" ${WARNING}
+                        echo_warning
+                        exit 2
+                    fi
+                fi
+                /sbin/autoipd -i $1 $AUTOIPD_START
+		# Save the return value
+		RET="$?"
+
+			echo ""
+			$(exit "$RET")
+			evaluate_retval
+
+        ;;
+
+        down)
+		boot_mesg -n "Stopping autoipd on the $1 interface..."
+			    echo ""
+			    killproc autoipd
+
+        ;;
+
+        *)
+                echo "Usage: $0 [interface] {up|down}"
+                exit 1
+        ;;
+esac
+
+# End $network_devices/services/autoipd-service

Added: trunk/ATTACHMENTS/wpa-service/wpa-init
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa-init	                        (rev 0)
+++ trunk/ATTACHMENTS/wpa-service/wpa-init	2006-04-02 16:25:03 UTC (rev 1027)
@@ -0,0 +1,89 @@
+#!/bin/sh
+# Begin $rc_base/init.d/wpa-init
+
+# Based on:
+#sysklogd script from LFS-6.1 and earlier.
+#dhcpcd service script from LFS-6.1.1
+# Rewritten by Eloi Primaux
+
+#$LastChangedBy: eloi $
+#$Date: 2006-03-31 -0300 21:03:42 (Fri, 31 Mar 2006) $
+
+. /etc/sysconfig/rc
+. $rc_functions
+. /etc/profile
+
+WPA_GLOBAL_FILE=/var/run/wpa_supplicant-global
+WPA_ACCESS_DIR=/var/run/wpa_supplicant
+WPA_PID_FILE=/var/run/wpa_supplicant.pid
+
+
+#wpa_supplicant process must be unique
+
+
+case "$1" in
+	start)
+		boot_mesg "Starting wpa_supplicant..."
+		if [ -f "$WPA_PID_FILE" ]
+                then
+                ps `cat "$WPA_PID_FILE"` | grep wpa_supplicant > /dev/null
+                    if [ $? != 0 ]
+                    then
+		   	ps -C wpa_supplicant | grep wpa_supplicant > /dev/null
+			if [  $? != 0 ]
+			then
+			boot_mesg "killing old wpa_supplicant daemon..." ${WARNING}
+                   	echo_warning
+COUNT=0
+			 while [ -n "$(ps -C wpa_supplicant | grep wpa_supplicant )" ]
+			 do
+let COUNT=$COUNT+1
+			 killall wpa_supplicant
+if [ $COUNT = 10 ]; then
+exit 2
+fi
+			 done
+		         rm -fr $WPA_GLOBAL_FILE $WPA_PID_FILE $WPA_ACCESS_DIR > /dev/null
+			fi
+                   else
+		   boot_mesg "wpa_supplicant already running!" ${WARNING}
+                   echo_warning
+                   exit 2
+                   fi
+		fi
+			wpa_supplicant -g$WPA_GLOBAL_FILE -P$WPA_PID_FILE -B
+
+		;;
+
+	stop)
+		boot_mesg "Stopping wpa_supplicant..."
+		i=1
+COUNT=0
+		while [ i != 0 ]
+		do
+let COUNT=$COUNT+1
+		ps -C wpa_supplicant | grep wpa_supplicant > /dev/null
+		i=$?
+		killall wpa_supplicant
+if [ $COUNT = 10 ]; then
+exit 2
+fi
+		done
+		rm -fr $WPA_GLOBAL_FILE $WPA_PID_FILE $WPA_ACCESS_DIR > /dev/null
+
+		;;
+
+
+	restart)
+		$0 stop
+		sleep 5
+		$0 start
+		;;
+
+	*)
+		echo "Usage: $0 {start|stop|restart}"
+		exit 1
+		;;
+esac
+
+# End $rc_base/init.d/wpa-init

Added: trunk/ATTACHMENTS/wpa-service/wpa-service
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa-service	                        (rev 0)
+++ trunk/ATTACHMENTS/wpa-service/wpa-service	2006-04-02 16:25:03 UTC (rev 1027)
@@ -0,0 +1,110 @@
+#!/bin/bash
+# Begin $network-devices/services/wpa-service
+
+# Based on dhcpcd script adapted for wpa networks with or without dhcp support
+# Rewritten by Eloi Primaux  - eloi AT bliscat DOT org
+# 2006-02-20 First script, wpa_supplicant is launched here, one wpa_supp per interface
+# 2006-02-21 Only one instance of wpa_supplicant for all interfaces, completely rewrited
+# 2006-02-22 lot of bugs fixed, now it uses the wpa_supplicant.conf format.
+# 2006-03-10 optimizing for (speed) boot process , just set interface up and let wpa_supp alone
+# 2006-03-31 Renaming from wpa_supplicant to wpa-service
+#This service REQUIRE the wpa_supplicant daemon running!
+#Which MUST be launched with the appropriate boot script wpa-init
+
+
+. /etc/sysconfig/rc
+. $rc_functions
+. $IFCONFIG
+
+#This is LFS specific
+	SERVICES_DIRECTORY="/etc/sysconfig/network-devices/services"
+# here is the socket file of wpa_supplicant pseudo network
+	WPA_GLOBAL_FILE="/var/run/wpa_supplicant-global"
+	WPA_GLOBAL_DIR="/var/run/wpa_supplicant"
+case "$2" in
+        up)
+
+# Beautifying....
+	echo -n "" # due to the pre ifconfig process
+
+# Todo...
+# example : if there is no network available...
+# FIXME
+
+
+
+# Here we add the wifi wpa interface, eg 'ifconfig up' but in wpa way
+
+# Add a new interface (no configuration file and enable control interface)
+RET=`$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_add $1 "" $WPA_DRIVER $WPA_GLOBAL_DIR`
+# Reading the wpa config file
+grep -v '#' $WPA_CONFIG_DIR/$WPA_CONFIG_FILE | while read line
+do
+	if [ "$line" = "network={" ]; then
+		# creating a new network configration, saving network number to NETWORK
+		NETWORK=`$WPA_CLIENT_NAME -i$1 add_network`
+	else
+	  	if [ "$line" = "}" ]; then
+	  	# now the network is configured, enabling it
+          	RET=`$WPA_CLIENT_NAME -i$1 enable_network $NETWORK`
+	  	else
+			if [ -n "$( echo "$line" |  grep -v "ctrl_interface")" ]; then
+			# all others lines should be network parameters...
+			# i need to replace the first '=' character by a pace
+			line="`echo "$line" | sed 's,=, ,'`"
+#For debugging (it's always here due to strings substitution) 
+#				echo "setting parameter : $line"
+#				echo "$WPA_CLIENT_NAME -i$1 set_network $NETWORK $line"
+			echo "$WPA_CLIENT_NAME -i$1 set_network $NETWORK $line" | sh > /dev/null # FIXME !!!
+			fi
+		fi
+	fi
+done
+
+
+# When the network is ready wpa_suplicant will answer "wpa_state=COMPLETED"
+# thus we will wait until conection is established to launch the ip service
+
+RET1="`$WPA_CLIENT_NAME -i$1 status | grep 'wpa_state' | cut -f2- -d=`"
+# we run a little loop to wait for wpa_supplicant being ready before launch ip service
+# to not loop undefinetly at boot time if the network is down...
+COUNTER=0
+while [ "$RET1" != "COMPLETED" ]
+do let COUNTER=$COUNTER+1
+        if [ "$COUNTER" = "$WPA_MAXCYCLE" ]; then
+        boot_mesg "interface $1 Timeout " ${WARNING}
+        $0 remove; exit 2
+        fi
+    sleep 5s
+
+    RET1="`$WPA_CLIENT_NAME -i$1 status | grep 'wpa_state' | cut -f2- -d=`"
+    RET="$?"
+        if [ $RET != 0 ]; then exit 2 ; fi
+        echo -n "$RET1... "
+done
+    echo ""
+    evaluate_retval
+$SERVICES_DIRECTORY/$IP_SERVICE_NAME $1 up
+
+
+        ;;
+
+        down)
+
+	$SERVICES_DIRECTORY/$IP_SERVICE_NAME $1 down
+	$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE disconnect $1 > /dev/null
+	$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_remove $1 > /dev/null
+
+        ;;
+
+	remove)
+	$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE disconnect $1 > /dev/null
+	$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_remove $1 > /dev/null
+	;;
+        *)
+                echo "Usage: $0 [interface] {up|down}"
+                exit 1
+        ;;
+esac
+
+# End $network_devices/services/wpa-service

Added: trunk/ATTACHMENTS/wpa-service/wpa-service-conf
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa-service-conf	                        (rev 0)
+++ trunk/ATTACHMENTS/wpa-service/wpa-service-conf	2006-04-02 16:25:03 UTC (rev 1027)
@@ -0,0 +1,37 @@
+ONBOOT="yes"
+SERVICE="wpa-service"
+
+ # the ip settings (note: only the debug version will print something)
+        IP_SERVICE_NAME="dhcpcd" # , autoipd-service or ipv4-static ... 
+                                 #copy their conf here
+ # This is the dhcpcd configuration taken from the BLFS Book
+        DHCP_START="-d "
+        DHCP_STOP="-k "
+ # Set PRINTIP="yes" to have the script print
+ # the DHCP assigned IP address
+        PRINTIP="no"
+ # Set PRINTALL="yes" to print the DHCP assigned values for
+ # IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
+        PRINTALL="no"
+ # This is the autoipd-service sample configuration
+ #AUTOIPD_START="-d -s 10.0.0.25 -m 10:0E:B5:8E:79:48 "
+ # -s : to start at this ip
+ # -m : to set this mac address
+
+ # The wpa settings
+
+ #the name of the wpa_supplicant client if it changes
+        WPA_CLIENT_NAME="wpa_cli"
+ # here is the directory where wpa_supplicant.conf should be
+        WPA_CONFIG_DIR="/etc/sysconfig/wpa_supplicant"
+ # here is the name of your wpa_supplicant.conf file
+        WPA_CONFIG_FILE="wpa_supplicant.conf"
+
+# Here you have to define which wpa driver wpa_supplicant will use for
+this interface
+        WPA_DRIVER="madwifi"
+
+# To avoid boot freezing on this service (truly true with the debug
+version)
+# one cycle each 5 seconds
+        WPA_MAXCYCLE=10

Copied: trunk/OLD/wpa-dhcpcd.txt (from rev 1025, trunk/wpa-dhcpcd.txt)
===================================================================
--- trunk/OLD/wpa-dhcpcd.txt	                        (rev 0)
+++ trunk/OLD/wpa-dhcpcd.txt	2006-04-02 16:25:03 UTC (rev 1027)
@@ -0,0 +1,278 @@
+AUTHOR: Eloi Primaux eloi at bliscat.org
+DATE: 2006-02-19
+LICENSE: GNU Free Documentation License Version 2
+SYNOPSIS: Setting a wireless network with WPA and dhcpcd
+DESCRIPTION:
+This hint purpose a way to set wireless networks using wpa_supplicant and dhcpcd
+
+ATTACHMENTS:
+no attachments yet
+
+PREREQUISITES:
+A full LFS-6.1 and BLFS-6.1 system already configured with a standart lan network
+The chipset driver of your wireless card (ex: madwifi http://madwifi.org/wiki/)
+wireless tools available at http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html
+wpa_supplicant available at http://hostap.epitest.fi/wpa_supplicant/ (latest stable release)
+dhcpcd installed from the blfs book
+
+
+note you will also require and access point which use wpa encryption and dhcp service
+
+HINT:
+
+this hint is mainly based on what has already been done in the blfs book for the dhcpcd service
+
+install chipset driver, wireless tools, and wpa_supplicant
+both of them have fully explanaited documentations to build them
+If you still in trouble, have a look to http://madwifi.org/wiki
+
+Now you need to create 2 files,
+1)	/etc/sysconfig/network-devices/service/wpa-dhcpcd
+2)	/etc/sysconfig/network-devices/ifconfig.XX/wpa-dhcpcd
+
+XX is  the name of your device, eth0,wlan0,ath0...
+
+Here are those files
+
+#######	1) wpa-dhcpcd service script	########
+#	
+#  /etc/sysconfig/network-devices/service/wpa-dhcpcd
+#
+####### start here ######
+
+#!/bin/sh
+# Begin $network-devices/services/wpa-dhcpcd
+
+# Based on dhcpcd script adapted for  wpa networks
+# Rewritten by Eloi Primaux  - eloi at bliscat.org
+
+
+. /etc/sysconfig/rc
+. $rc_functions
+. $IFCONFIG
+
+DHCPCD_PIDFILE="/var/run/dhcpcd-$1.pid"
+DHCPCD_LEASEINFO="/var/lib/dhcpc/dhcpcd-$1.info"
+WPA_PIDFILE="/var/run/wpa_supplicant-$1.pid"
+#WPA_CONFIGFILE="/etc/sysconfig/network-devices/ifconfig.$1/wpa-dhcpcd"
+#. $WPA_CONFIGFILE
+WPA_SCRP="/etc/sysconfig/network-devices/wpa-script.$1"
+rm -f $WPA_SCRP
+case "$2" in
+        up)
+	RET=$?
+	evaluate_retval
+	echo "" # due to the pre ifconfig process
+	# Start wpa_supplicant in the background
+	wpa_supplicant -g/var/run/wpa_supplicant-$1-global -P$WPA_PIDFILE -B
+	#We must check if our requested SSID is available...
+	boot_mesg "Scanning for available Access Points..."
+	iwlist ath0 scan | grep "ESSID"
+	SSID_AVAILABLE=$(iwlist ath0 scan | grep "$WPA_SSID")
+	if [ -n "$SSID_AVAILABLE" ]; then
+		boot_mesg  "The Access Point "$WPA_SSID" is  available, connecting"
+		echo_ok
+		# Add a new interface (no configuration file and
+		# enable control interface)
+		echo "wpa_cli -g/var/run/wpa_supplicant-$1-global interface_add $1 \"\" $WPA_DRIVER /var/run/wpa_supplicant" > $WPA_SCRP
+		# Configure a network using the newly added network interface:
+		echo "wpa_cli -i$1 add_network" >> $WPA_SCRP
+		echo "wpa_cli -i$1 set_network 0 ssid '\"$WPA_SSID\"'" >> $WPA_SCRP
+		echo "wpa_cli -i$1 set_network 0 key_mgmt WPA-PSK" >> $WPA_SCRP
+		echo "wpa_cli -i$1 set_network 0 psk '\"$WPA_PASS\"'" >> $WPA_SCRP
+		echo "wpa_cli -i$1 set_network 0 pairwise $WPA_PAIRWISE" >> $WPA_SCRP
+		echo "wpa_cli -i$1 set_network 0 group $WPA_GROUP" >> $WPA_SCRP
+		echo "wpa_cli -i$1 set_network 0 proto $WPA_PROTO" >> $WPA_SCRP
+		echo "wpa_cli -i$1 enable_network 0" >> $WPA_SCRP
+		#Now we run the little script created above
+		boot_mesg -n "Booting wpa_supplicant on the $1 interface..."
+		. $WPA_SCRP > /dev/null
+		RET=$?
+		evaluate_retval
+		#Now we overwrite the last script by one which request the wpa status
+		# When the network is ready it will answer "wpa_state=COMPLETED"
+		echo "wpa_cli -i$1 status | grep 'wpa_state' | sed 's,wpa_state=,,g'" > $WPA_SCRP
+		# we run a little loop to wait for wpa_supplicant being ready
+		boot_mesg "Please wait while the daemon is connecting to $WPA_SSID..."
+			RET=$(. $WPA_SCRP)
+			COUNTER=0 # to not loop undefinetly at boot time if the network is down...
+		while [ "$RET" != "COMPLETED" ]; do
+			if [ "$COUTER" = "$WPA_MAXCYCLE" ]; then
+			boot_mesg "The Access Point $WPA_SSID is available" ${WARNING}
+			boot_mesg "But the connecting time is over . This is" ${WARNING}
+			boot_mesg "Mostly due to a misconfigurated network." ${WARNING}
+			boot_mesg "Please check your configuration" ${WARNING}
+                        echo_warning
+                        exit 2
+		fi
+			sleep 5s
+			RET=$(. $WPA_SCRP)
+			echo -n "$RET..."
+        	done
+		echo ""
+		echo_ok
+		
+		# At this point, the new network interface should start trying to associate
+		# with the WPA-PSK network using SSID.
+
+
+		boot_mesg  "Starting dhcpcd on the $1 interface..."
+                # Test to see if there is a stale pid file
+                if [ -f "$DHCPCD_PIDFILE" ]
+                then
+                    ps `cat "$DHCPCD_PIDFILE"` | grep dhcpcd > /dev/null
+                    if [ $? != 0 ]
+                    then
+                        rm -f $DHCPCD_PIDFILE > /dev/null
+                    else
+			boot_mesg "dhcpcd already running!" ${WARNING}
+                        echo_warning
+                        exit 2
+                    fi
+                fi
+                /sbin/dhcpcd $1 $DHCP_START
+		# Save the return value
+		RET="$?"
+		# Print the assigned settings if requested
+		if [ "$RET" = "0" -a "$PRINTIP" = "yes" ]; then
+			. /var/lib/dhcpc/dhcpcd-$1.info
+			if [ "$PRINTALL" = "yes" ]; then
+				echo ""
+				echo_ok
+				boot_mesg "           DHCP Assigned Settings for $1:"
+				boot_mesg_flush
+				boot_mesg "           IP Address:      $IPADDR"
+				boot_mesg_flush
+				boot_mesg "           Subnet Mask:     $NETMASK"
+				boot_mesg_flush
+				boot_mesg "           Default Gateway: $GATEWAY"
+				boot_mesg_flush
+				boot_mesg "           DNS Server:      $DNS"
+				boot_mesg_flush
+			else
+				boot_mesg " IP Addresss: ""$IPADDR"
+				echo_ok
+			fi
+		else
+			echo ""
+			$(exit "$RET")
+			evaluate_retval
+		fi
+	else
+		boot_mesg "The Access Point "$WPA_SSID" is not available" ${WARNING}
+		boot_mesg "Please check your configuration" ${WARNING}
+                        echo_warning
+                        exit 2
+	fi
+
+        ;;
+
+        down)
+		boot_mesg -n "Stopping dhcpcd on the $1 interface..."
+		# Do nothing with the client daemon if we have an infinate 
+		# lease time as the client exits when started in this case,
+		# just echo OK.
+		if [ -e $DHCPCD_LEASEINFO ]
+		then
+		    . $DHCPCD_LEASEINFO
+
+		    if [ "$DHCPCD_LEASETIME" = "4294967295" ]
+		    then
+			# do nothing, just echo ok
+			echo ""
+			echo_ok
+		    else
+			if [ -n "$DHCP_STOP" ]
+			then
+			    /sbin/dhcpcd $1 $DHCP_STOP &> /dev/null
+			    RET="$?"
+			    if [ "$RET" -eq 0 ]; then
+				echo ""
+				echo_ok
+			    elif [ "$RET" -eq 1 ]; then
+				boot_mesg "dhcpcd not running!" ${WARNING}
+				echo_warning
+			    else
+				echo ""
+				echo_failure
+			    fi
+			else
+			    echo ""
+			    killproc dhcpcd
+			fi
+		    fi
+		else
+		    boot_mesg -n "LEASEINFO Test failed! - " ${WARNING}
+		    boot_mesg "dhcpcd is not running!" ${WARNING}
+		    echo_warning
+		    exit 1
+		fi
+		boot_mesg "Stopping wpa_supplicant on the $1 interface..."
+		killproc -p $WPA_PIDFILE wpa_supplicant
+
+
+        ;;
+
+        *)
+                echo "Usage: $0 [interface] {up|down}"
+                exit 1
+        ;;
+esac
+
+# End $network_devices/services/wpa-dhcpcd
+
+
+#### end here####
+
+
+
+
+#######	2) wpa-dhcpcd config file	########
+#
+# /etc/sysconfig/network-devices/ifconfig.XX/wpa-dhcpcd
+# XX is  the name of your device, eth0,wlan0,ath0...
+#
+#### start here #####
+
+#This config file is mostly based of the
+#dhcpcd config file
+
+ONBOOT="yes"
+SERVICE="wpa-dhcpcd"
+DHCP_START="-d " # to print some debug informations
+DHCP_STOP="-k "
+WPA_SSID="Your SSID"  
+WPA_DRIVER="Your Driver"
+WPA_PROTO="Your Proto" # WPA2 for WPA2-PSK check the wpa-supplicant readme
+WPA_PAIRWISE="Your Pairwise" # CCMP for AES
+WPA_GROUP="Your Group" # CCMP for AES
+WPA_PASS="Your very secret WPA password"
+
+#one cycle each 5 seconds
+WPA_MAXCYCLE=24 # 120s
+# Set PRINTIP="yes" to have the script print
+# the DHCP assigned IP address
+PRINTIP="no"
+
+# Set PRINTALL="yes" to print the DHCP assigned values for
+# IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
+PRINTALL="yes"
+
+
+### End Here ##### 
+
+
+do a chmod 755 /etc/sysconfig/network-devices/service/wpa-dhcpcd
+and if you correctly set the config file, just type
+/etc/rc.d/init.d/network restart if you can use the connection then
+your wireless network will be set at boot time
+
+ACKNOWLEDGEMENTS:
+
+
+CHANGELOG:
+
+-- 
+http://linuxfromscratch.org/mailman/listinfo/hints
+FAQ: http://www.linuxfromscratch.org/faq/
+Unsubscribe: See the above information page

Deleted: trunk/wpa-dhcpcd.txt
===================================================================
--- trunk/wpa-dhcpcd.txt	2006-04-02 16:13:30 UTC (rev 1026)
+++ trunk/wpa-dhcpcd.txt	2006-04-02 16:25:03 UTC (rev 1027)
@@ -1,278 +0,0 @@
-AUTHOR: Eloi Primaux eloi at bliscat.org
-DATE: 2006-02-19
-LICENSE: GNU Free Documentation License Version 2
-SYNOPSIS: Setting a wireless network with WPA and dhcpcd
-DESCRIPTION:
-This hint purpose a way to set wireless networks using wpa_supplicant and dhcpcd
-
-ATTACHMENTS:
-no attachments yet
-
-PREREQUISITES:
-A full LFS-6.1 and BLFS-6.1 system already configured with a standart lan network
-The chipset driver of your wireless card (ex: madwifi http://madwifi.org/wiki/)
-wireless tools available at http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html
-wpa_supplicant available at http://hostap.epitest.fi/wpa_supplicant/ (latest stable release)
-dhcpcd installed from the blfs book
-
-
-note you will also require and access point which use wpa encryption and dhcp service
-
-HINT:
-
-this hint is mainly based on what has already been done in the blfs book for the dhcpcd service
-
-install chipset driver, wireless tools, and wpa_supplicant
-both of them have fully explanaited documentations to build them
-If you still in trouble, have a look to http://madwifi.org/wiki
-
-Now you need to create 2 files,
-1)	/etc/sysconfig/network-devices/service/wpa-dhcpcd
-2)	/etc/sysconfig/network-devices/ifconfig.XX/wpa-dhcpcd
-
-XX is  the name of your device, eth0,wlan0,ath0...
-
-Here are those files
-
-#######	1) wpa-dhcpcd service script	########
-#	
-#  /etc/sysconfig/network-devices/service/wpa-dhcpcd
-#
-####### start here ######
-
-#!/bin/sh
-# Begin $network-devices/services/wpa-dhcpcd
-
-# Based on dhcpcd script adapted for  wpa networks
-# Rewritten by Eloi Primaux  - eloi at bliscat.org
-
-
-. /etc/sysconfig/rc
-. $rc_functions
-. $IFCONFIG
-
-DHCPCD_PIDFILE="/var/run/dhcpcd-$1.pid"
-DHCPCD_LEASEINFO="/var/lib/dhcpc/dhcpcd-$1.info"
-WPA_PIDFILE="/var/run/wpa_supplicant-$1.pid"
-#WPA_CONFIGFILE="/etc/sysconfig/network-devices/ifconfig.$1/wpa-dhcpcd"
-#. $WPA_CONFIGFILE
-WPA_SCRP="/etc/sysconfig/network-devices/wpa-script.$1"
-rm -f $WPA_SCRP
-case "$2" in
-        up)
-	RET=$?
-	evaluate_retval
-	echo "" # due to the pre ifconfig process
-	# Start wpa_supplicant in the background
-	wpa_supplicant -g/var/run/wpa_supplicant-$1-global -P$WPA_PIDFILE -B
-	#We must check if our requested SSID is available...
-	boot_mesg "Scanning for available Access Points..."
-	iwlist ath0 scan | grep "ESSID"
-	SSID_AVAILABLE=$(iwlist ath0 scan | grep "$WPA_SSID")
-	if [ -n "$SSID_AVAILABLE" ]; then
-		boot_mesg  "The Access Point "$WPA_SSID" is  available, connecting"
-		echo_ok
-		# Add a new interface (no configuration file and
-		# enable control interface)
-		echo "wpa_cli -g/var/run/wpa_supplicant-$1-global interface_add $1 \"\" $WPA_DRIVER /var/run/wpa_supplicant" > $WPA_SCRP
-		# Configure a network using the newly added network interface:
-		echo "wpa_cli -i$1 add_network" >> $WPA_SCRP
-		echo "wpa_cli -i$1 set_network 0 ssid '\"$WPA_SSID\"'" >> $WPA_SCRP
-		echo "wpa_cli -i$1 set_network 0 key_mgmt WPA-PSK" >> $WPA_SCRP
-		echo "wpa_cli -i$1 set_network 0 psk '\"$WPA_PASS\"'" >> $WPA_SCRP
-		echo "wpa_cli -i$1 set_network 0 pairwise $WPA_PAIRWISE" >> $WPA_SCRP
-		echo "wpa_cli -i$1 set_network 0 group $WPA_GROUP" >> $WPA_SCRP
-		echo "wpa_cli -i$1 set_network 0 proto $WPA_PROTO" >> $WPA_SCRP
-		echo "wpa_cli -i$1 enable_network 0" >> $WPA_SCRP
-		#Now we run the little script created above
-		boot_mesg -n "Booting wpa_supplicant on the $1 interface..."
-		. $WPA_SCRP > /dev/null
-		RET=$?
-		evaluate_retval
-		#Now we overwrite the last script by one which request the wpa status
-		# When the network is ready it will answer "wpa_state=COMPLETED"
-		echo "wpa_cli -i$1 status | grep 'wpa_state' | sed 's,wpa_state=,,g'" > $WPA_SCRP
-		# we run a little loop to wait for wpa_supplicant being ready
-		boot_mesg "Please wait while the daemon is connecting to $WPA_SSID..."
-			RET=$(. $WPA_SCRP)
-			COUNTER=0 # to not loop undefinetly at boot time if the network is down...
-		while [ "$RET" != "COMPLETED" ]; do
-			if [ "$COUTER" = "$WPA_MAXCYCLE" ]; then
-			boot_mesg "The Access Point $WPA_SSID is available" ${WARNING}
-			boot_mesg "But the connecting time is over . This is" ${WARNING}
-			boot_mesg "Mostly due to a misconfigurated network." ${WARNING}
-			boot_mesg "Please check your configuration" ${WARNING}
-                        echo_warning
-                        exit 2
-		fi
-			sleep 5s
-			RET=$(. $WPA_SCRP)
-			echo -n "$RET..."
-        	done
-		echo ""
-		echo_ok
-		
-		# At this point, the new network interface should start trying to associate
-		# with the WPA-PSK network using SSID.
-
-
-		boot_mesg  "Starting dhcpcd on the $1 interface..."
-                # Test to see if there is a stale pid file
-                if [ -f "$DHCPCD_PIDFILE" ]
-                then
-                    ps `cat "$DHCPCD_PIDFILE"` | grep dhcpcd > /dev/null
-                    if [ $? != 0 ]
-                    then
-                        rm -f $DHCPCD_PIDFILE > /dev/null
-                    else
-			boot_mesg "dhcpcd already running!" ${WARNING}
-                        echo_warning
-                        exit 2
-                    fi
-                fi
-                /sbin/dhcpcd $1 $DHCP_START
-		# Save the return value
-		RET="$?"
-		# Print the assigned settings if requested
-		if [ "$RET" = "0" -a "$PRINTIP" = "yes" ]; then
-			. /var/lib/dhcpc/dhcpcd-$1.info
-			if [ "$PRINTALL" = "yes" ]; then
-				echo ""
-				echo_ok
-				boot_mesg "           DHCP Assigned Settings for $1:"
-				boot_mesg_flush
-				boot_mesg "           IP Address:      $IPADDR"
-				boot_mesg_flush
-				boot_mesg "           Subnet Mask:     $NETMASK"
-				boot_mesg_flush
-				boot_mesg "           Default Gateway: $GATEWAY"
-				boot_mesg_flush
-				boot_mesg "           DNS Server:      $DNS"
-				boot_mesg_flush
-			else
-				boot_mesg " IP Addresss: ""$IPADDR"
-				echo_ok
-			fi
-		else
-			echo ""
-			$(exit "$RET")
-			evaluate_retval
-		fi
-	else
-		boot_mesg "The Access Point "$WPA_SSID" is not available" ${WARNING}
-		boot_mesg "Please check your configuration" ${WARNING}
-                        echo_warning
-                        exit 2
-	fi
-
-        ;;
-
-        down)
-		boot_mesg -n "Stopping dhcpcd on the $1 interface..."
-		# Do nothing with the client daemon if we have an infinate 
-		# lease time as the client exits when started in this case,
-		# just echo OK.
-		if [ -e $DHCPCD_LEASEINFO ]
-		then
-		    . $DHCPCD_LEASEINFO
-
-		    if [ "$DHCPCD_LEASETIME" = "4294967295" ]
-		    then
-			# do nothing, just echo ok
-			echo ""
-			echo_ok
-		    else
-			if [ -n "$DHCP_STOP" ]
-			then
-			    /sbin/dhcpcd $1 $DHCP_STOP &> /dev/null
-			    RET="$?"
-			    if [ "$RET" -eq 0 ]; then
-				echo ""
-				echo_ok
-			    elif [ "$RET" -eq 1 ]; then
-				boot_mesg "dhcpcd not running!" ${WARNING}
-				echo_warning
-			    else
-				echo ""
-				echo_failure
-			    fi
-			else
-			    echo ""
-			    killproc dhcpcd
-			fi
-		    fi
-		else
-		    boot_mesg -n "LEASEINFO Test failed! - " ${WARNING}
-		    boot_mesg "dhcpcd is not running!" ${WARNING}
-		    echo_warning
-		    exit 1
-		fi
-		boot_mesg "Stopping wpa_supplicant on the $1 interface..."
-		killproc -p $WPA_PIDFILE wpa_supplicant
-
-
-        ;;
-
-        *)
-                echo "Usage: $0 [interface] {up|down}"
-                exit 1
-        ;;
-esac
-
-# End $network_devices/services/wpa-dhcpcd
-
-
-#### end here####
-
-
-
-
-#######	2) wpa-dhcpcd config file	########
-#
-# /etc/sysconfig/network-devices/ifconfig.XX/wpa-dhcpcd
-# XX is  the name of your device, eth0,wlan0,ath0...
-#
-#### start here #####
-
-#This config file is mostly based of the
-#dhcpcd config file
-
-ONBOOT="yes"
-SERVICE="wpa-dhcpcd"
-DHCP_START="-d " # to print some debug informations
-DHCP_STOP="-k "
-WPA_SSID="Your SSID"  
-WPA_DRIVER="Your Driver"
-WPA_PROTO="Your Proto" # WPA2 for WPA2-PSK check the wpa-supplicant readme
-WPA_PAIRWISE="Your Pairwise" # CCMP for AES
-WPA_GROUP="Your Group" # CCMP for AES
-WPA_PASS="Your very secret WPA password"
-
-#one cycle each 5 seconds
-WPA_MAXCYCLE=24 # 120s
-# Set PRINTIP="yes" to have the script print
-# the DHCP assigned IP address
-PRINTIP="no"
-
-# Set PRINTALL="yes" to print the DHCP assigned values for
-# IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
-PRINTALL="yes"
-
-
-### End Here ##### 
-
-
-do a chmod 755 /etc/sysconfig/network-devices/service/wpa-dhcpcd
-and if you correctly set the config file, just type
-/etc/rc.d/init.d/network restart if you can use the connection then
-your wireless network will be set at boot time
-
-ACKNOWLEDGEMENTS:
-
-
-CHANGELOG:
-
--- 
-http://linuxfromscratch.org/mailman/listinfo/hints
-FAQ: http://www.linuxfromscratch.org/faq/
-Unsubscribe: See the above information page

Added: trunk/wpa-service
===================================================================
--- trunk/wpa-service	                        (rev 0)
+++ trunk/wpa-service	2006-04-02 16:25:03 UTC (rev 1027)
@@ -0,0 +1,412 @@
+AUTHOR: Eloi Primaux eloi AT bliscat dot org
+
+DATE: 2006-03-31
+
+LICENSE: GNU Free Documentation License Version 2
+
+SYNOPSIS:
+Setting up a wifi interface using wpa_supplicant and LFS IP services
+
+DESCRIPTION:
+
+ATTACHMENTS:
+
+http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/wpa-service
+http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/wpa-service-conf
+http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/wpa-init
+http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/autopid-service
+
+
+PREREQUISITES:
+
+1)   A working LFS-6.1 system or newer with wireless capabilities  
+1.a) Linux kernel 2.6.14 or newest                          (0)
+1.b) Wireless Cards Drivers
+2)   An IP service
+2.a) Static IP service                                      (1)
+2.b) Dynamic IP service                                     (1)
+2.c) Static IP discovering helper                           (2)
+3)   Wireless Networks helper programs
+3.a) Wireless tools                           
+3.b) wpa_supplicant    
+4)   This hint with its 4 files                   
+5)   A working firewall
+5.a) Basic firewalling capabilities                         (1)(2)
+5.b) Shoreline firewall                                     (2)
+
+(0) The Linux kernels shipped with LFS-6.1 and 6.1.1 are too old,
+    please consider upgrading to 2.14 or 2.16 kernels.
+    The Linux kernel maintainers have changed some references in
+    the 2.6.16 .config file, thus firewalling capabilities will be disable
+    when using a .config from a 2.14 kernel or older.
+(1) See BLFS book
+(2) Not needed but recommended
+ 
+HINT:
+
+1) A working LFS-6.1 system or newer with wireless capabilities
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+1.a) The Wireless Capabilities of the Linux kernel
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Configuring the kernel:
+
+Networking  ---> 
+[*] Networking support
+ <M>   Generic IEEE 802.11 Networking Stack
+ <M>     IEEE 802.11 WEP encryption (802.1x)
+ <M>     IEEE 802.11i CCMP support
+ <M>     IEEE 802.11i TKIP encryption    
+Device Drivers  --->
+    Network device support  --->
+        Wireless LAN (non-hamradio)  --->
+        [*] Wireless LAN drivers (non-hamradio) & Wireless Extensions
+   << and select your driver from the list if shipped with the Linux Kernel >>
+Cryptographic options  --->
+ <M>   AES cipher algorithms
+
+Now compile, install , enable your new kernel in your boot loader and restart
+using it.
+
+1.b) The Wireless Cards Drivers
+If your driver wasn't shipped with the Linux Kernel then you need to install a
+third party driver.
+
+Be aware that most of those independent driver are in development stage and they
+probably won't be available in tarballs but from a CVS repository or from a
+subversion one. Then you will need those tools to download it, both of cvs and
+svn installations are explained in the BLFS book.
+
+Please also consider reading the "Wireless LAN resources for Linux" HOWTO for
+chipsets driver name.
+
+As an example, most Artheos cards are supported by the madwifi project: link:
+http://madwifi.org/wiki without doing advertising for them this wiki is full of
+information and links referring to WPA encrypted networks
+
+2) The IP services
+~~~~~~~~~~~~~~~~~~
+
+You should know that networks interfaces need IP addresses and also that some
+networks have DHCP servers some other don't. Without explaining the benefit of
+having a DHCP server, i will just say that a DHCP server provides IP to all
+attached network interfaces (it also provides the IP of the gateway, the network
+mask and the IP of DNS servers)
+
+Essentials IP services installation and configuration are in the BLFS Book.  You
+will size the benefit of the wpa-service when you will understand that this
+service only attach your card to an wireless WPA network and when it did it, it
+simply launch the desired IP service as if your system were setting up usual
+network cards.
+
+Then, you only have to know which IP service your network uses : Is it a STATIC
+or a DYNAMIC network ?
+
+2.a) Static IP service
+~~~~~~~~~~~~~~~~~~~~~~
+        IP service will be ipv4-static
+This service is shipped with the LFS Book (6.1 and newer)
+
+2.b) Dynamic IP service
+~~~~~~~~~~~~~~~~~~~~~~~
+        IP service will be dhcpcd
+This service is described in the BLFS Book (6.1 and newer)
+
+2.c) Static IP discovering helper (Zeroconf like)
+Use it when you really don't know what to do
+        IP service will be autoipd-service
+This service is not yet shipped anywhere for LFS systems then i did it
+
+2.c.1) The Howl installation
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Refer you to :
+link: http://www.porchdogsoft.com/products/howl/InstallUnix.html
+But set the prefix to /usr
+
+Now copy the autoipd-service to the network service directory:
+
+cp autoipd-service /etc/sysconfig/network-devices/services
+And make it executable:
+
+chmod 755 -c /etc/sysconfig/network-devices/services/autoipd-service
+
+3) Wireless Networks helper programs
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+3.a) Wireless tools
+~~~~~~~~~~~~~~~~~~~
+This helper is not need by the wpa-service but can be really helpful.
+
+Then, download the latest development version of this tool named
+'wireless_tools' execute the following command in its directory :
+
+find ./ -name 'Makefile' -exec sed 's,/usr/local,/usr,g' &&
+make &&
+make install
+
+3.b) wpa_supplicant 'The core'
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This is NOT an usual step if you omit something here you won't be able to attach
+your device to any access point
+
+Please use the 0.4.8 version or newer and NOT the 0.4.7, available at: link:
+http://hostap.epitest.fi/wpa_supplicant
+
+Again, i strongly recommend you to read its README before doing anything.
+wpa_supplicant may need the source of your drivers then edit the .config file as
+described in the README and set all constants according to your system.  also
+when ready install it by executing :
+
+find ./ -name 'Makefile' -exec sed 's,/usr/local,/usr,g' &&
+make &&
+make install
+
+4) This Hints
+~~~~~~~~~~~~~
+
+wpa_supplicant is designed to be a "daemon" program that runs in the background
+and acts as the back-end component controlling the wireless connection.
+wpa_supplicant supports separate front-end programs and a text-based front-end
+(wpa_cli) is included with wpa_supplicant.
+
+4.1) The wpa-init file
+~~~~~~~~~~~~~~~~~~~~~~
+
+The wpa-service will use the text-based front-end to controls the wpa_supplicant
+daemon. This requires wpa_supplicant daemon running. Thus copy the wpa-init file
+to the init script directory and make it executable:
+
+cp wpa-init /etc/rc.d/init.d
+chmod 755 -c /etc/rc.d/init.d/wpa-init
+
+According to the last lfs-bootscript, link it to some run levels:
+
+ln -sv /etc/rc.d/init.d/wpa-init /etc/rc.d/rc3.d/S15wpa-init
+ln -sv /etc/rc.d/init.d/wpa-init /etc/rc.d/rc5.d/S15wpa-init
+ln -sv /etc/rc.d/init.d/wpa-init /etc/rc.d/rc0.d/K75wpa-init
+ln -sv /etc/rc.d/init.d/wpa-init /etc/rc.d/rc6.d/K65wpa-init
+
+4.2) The wpa-service file
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This step is similar to the autoipd-service:
+
+Copy the wpa-service to the network service directory:
+
+cp wpa-service /etc/sysconfig/network-devices/services
+
+And make it executable:
+
+chmod 755 -c /etc/sysconfig/network-devices/services/wpa-service
+
+
+4.3) Configuring the wireless interface
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+4.3.a) The wireless network config file wpa-service-conf
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+According to your driver manual, you should have a specific device name for your
+interface, it could be eth[X],wlan[X],ath[X],... (where [X] is a number)
+  
+Following the LFS Book, you need to create a directory in the network directory
+where will be placed the wpa-service-conf, here is an example: create the
+directory /etc/sysconfig/network-devices/ifconfig.wlan[X] :
+
+install -d /etc/sysconfig/network-devices/ifconfig.wlan[X]
+
+copy the sample config file wpa-service-conf to the upper created directory:
+
+cp wpa-service-conf /etc/sysconfig/network-devices/ifconfig.wlan[X]
+
+Edit this file to fit with your driver and IP service with the services names
+proposed in section 2)
+
+4.3.b) The wpa_supplicant.conf (The network description) 
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+a) Limitations
+~~~~~~~~~~~~~~
+
+The wpa_supplicant README and wiki explain the composition of this file.  But
+wpa-service have some limitation due to strings substitution. Indeed password or
+protocol list can comport space characters, which may be altered by the service
+script if not correctly quoted and then mess up the wpa_cli front-end. I did'nt
+yet found a script solution but if you take care to correctly quote strings
+containing space characters you won't have any trouble.
+
+b) Specific quoting
+~~~~~~~~~~~~~~~~~~~
+A space string MUST be quoted like that:
+'"This is a string containing some space characters"'
+
+c) File syntax
+~~~~~~~~~~~~~~
+
+The file syntax is the wpa_supplicant.conf file syntax, it is specific to the
+wpa_supplicant program and only depend of the programmer choice, thus instead of
+explaining you of how this file is read, i will show you a set of command to
+create a config file with wpa_supplicant.
+
+in a bash shell execute:
+
+wpa_passphrase <ssid> [passphrase] > wpa_supplicant.conf
+
+Where <ssid> is the name of the access point and where [pasphrase] is your ...
+pass-phrase.
+
+Now edit the newly created wpa_supplicant.conf file:
+Which should contains something similar to:
+
+network={
+        ssid="ssid"
+        #psk="passphrase"
+
+psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726
+}
+
+Please quote correctly the strings containing the space characters
+
+you will directly see that you can define more than one network in this file,
+that's why wpa_supplicant is very nice: it chooses automatically in its
+configuration file the best (aka secure and available) network to connect.
+
+But at this time your network need to be tuned:
+
+open a new console and launch in the foreground wpa_supplicant in debug mode:
+
+wpa_supplicant -g/var/run/wpa_supplicant-global \
+               -P/var/run/wpa_supplicant.pid -ddd
+
+this will make wpa_supplicant to output anything to us.
+
+Now start the wpa_cli :
+
+wpa_cli -g/var/run/wpa_supplicant-global interface_add wlan[X]
+"" [driver] \
+        /var/run/wpa_supplicant
+
+Where wlan[X] is the device name of your network interface and where [driver] is
+the name of your driver
+
+examples:
+wpa_cli -g/var/run/wpa_supplicant-global interface_add ath0 "" madwifi \
+        /var/run/wpa_supplicant
+wpa_cli -g/var/run/wpa_supplicant-global interface_add eth1 "" wext \
+        /var/run/wpa_supplicant
+
+if it fail, please have a look to the output of the wpa_supplicant daemon
+
+wpa_cli -iwlan[X] -p/var/run/wpa_supplicant
+
+Then in wpa_cli type :
+
+scan
+
+and after some seconds type
+
+scan_result
+
+This will output a list of available networks.
+
+As an example:
+
+
+root at bliscat:/home/eloi# wpa_cli -iath0 -p/var/run/wpa_supplicant
+wpa_cli v0.4.8
+Copyright (c) 2004-2005, Jouni Malinen <jkmaline at cc.hut.fi> and
+contributors
+
+This program is free software. You can distribute it and/or modify it
+under the terms of the GNU General Public License version 2.
+
+Alternatively, this software may be distributed under the terms of the
+BSD license. See README and COPYING for more details.
+
+
+Selected interface 'ath0'
+
+Interactive mode
+
+> scan
+OK
+> scan_result
+bssid / frequency / signal level / flags / ssid
+00:0f:b5:ee:af:8f       2437    212     [WPA2-PSK-CCMP-preauth] MY_net
+00:10:c6:eb:95:11       2457    205     [WEP]   Wanadoo_5441
+
+
+you can see that my network 'My_net' use WPA2-PSK-CCMP which is WPA-PSK with
+CCMP as group and pairwise
+
+type exit to quit wpa_cli
+
+
+With this output we can now feed the wpa_supplicant.conf file:
+
+network={
+        ssid="ssid"
+        ssid='essid' # please quote '""' when you have a space character
+        scan_ssid=1
+        key_mgmt=WPA-PSK
+        proto=WPA2
+        pairwise=CCMP
+        group=CCMP
+        #psk='"passphrase"'
+
+psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726
+character
+}
+
+
+Note if you wish you can only use the human readable pass-phrase, then uncomment
+it and comment the hexadecimal pass-phrase
+
+Now kill the last instance of the wpa_supplicant:
+
+killall wpa_supplicant
+
+And test your new configuration file:
+
+wpa_supplicant -dmadwifi -iath0 -c./wpa_supplicant.conf -dd
+
+If you see something like SUCCESS it's done, kill it again and copy the config
+file to a secure directory:
+
+install -d /etc/sysconfig/wpa_supplicant
+chmod 700 -c /etc/sysconfig/wpa_supplicant
+cp wpa_supplicant.conf /etc/sysconfig/wpa_supplicant/wpa_supplicant.conf
+chmod 600 -c /etc/sysconfig/wpa_supplicant/wpa_supplicant.conf
+
+5) The firewall
+~~~~~~~~~~~~~~~
+
+You should understand that connecting to a network is never secure (even with a
+WPA encrypted network) especially without firewall. Then having a firewall will
+ever be a good thing, i strongly recommend the use of Shorewall.  You will find
+lots of help on its website.
+
+
+6) The End
+~~~~~~~~~~
+execute:
+
+/etc/rc.d./init.d/wpa-init restart
+/etc/rc.d/init.d/network restart
+
+if there is no errors, and your system is connected, then you can safely restart
+your computer to see it setting up your wireless card at boot time.
+
+ACKNOWLEDGMENTS:
+ The wireless hint
+ The Wireless HOWTO
+ wpa_supplicant README
+ The madwifi wiki
+ The LFS/BLFS Books
+
+
+CHANGELOG:
+2006 03 10 Second release, first send to lfshint
+2006 03 16 added some words to help wpa-supplicant.conf writing
+2006 03 18 fix wrong paths
+2006 03 31 Rewritten and try to match the LFS-standard thank's to
+archaic's help
+




More information about the hints mailing list