$ sudo cat wpa_supplicant.conf
# This line enables the use of wpa_cli which is used by rc.wireless
# if possible (to check for successful association)
ctrl_interface=/var/run/wpa_supplicant
# By default, only root (group 0) may use wpa_cli
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1
# WPA
network={
scan_ssid=0
ssid="xxxx" # ssid here
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP WEP104 WEP40
psk="xxxxxxxx" # key here
}
I don't use the rc.wireless comes from Slackware Linux, and I made one script of my own:
#!/bin/sh
#
# Written for switching network profiles.
# by Cherife Li <cherife@dotimes.com-RemoveMe->
# Turn off the interface:
interfaceoff() {
if [ "`ifconfig|egrep eth0`" ]; then
ifconfig eth0 down
fi
if [ "`ifconfig|egrep wlan0`" ]; then
ifconfig wlan0 down
fi
}
# Manage WPA daemon:
wpadaemon() {
if [ ! -d /var/run/wpa_supplicant ]; then
wpa_supplicant -wB -iwlan0 -c/etc/wpa_supplicant.conf
fi
}
case "$1" in
wifi-work)
interfaceoff
wpadaemon
ifconfig wlan0 192.168.xx.xx netmask 255.255.255.0 up
route add default gw 192.168.xx.xx wlan0
iwconfig wlan0 essid xx
;;
wifi-home)
interfaceoff
wpadaemon
ifconfig wlan0 192.168.xx.xx netmask 255.255.255.0 up
route add default gw 192.168.xx.xx wlan0
iwconfig wlan0 essid xx
;;
eth)
interfaceoff
ifconfig eth0 192.168.xx.xx netmask 255.255.255.0 up
route add default gw 192.168.xx.xx eth0
;;
*)
echo "usage: $0 {wifi-work|wifi-home|eth}"
esac
Back to Index of Running Slackware Linux on ThinkPad T61.| Valid XHTML & CSS©2008 dOtImes.cOm, All rights reserved.Creative CommonsLinux on LaptopsTuxMobilFirefox |
Posted and Maintained by Cherife Li Last Update: Monday, 2008-11-17, 16:08, UTC+8. |