Tuesday, 14 September 2010

Slackware Linux Wireless mystery..

There are three primary configuration files that need to be configured before we can use our card, and they are:
/etc/rc.d/rc.inet1.conf
/etc/rc.d/rc.wireless.conf
/etc/wpa_supplicant.conf

First, I must mention that I find the rc.wireless.conf to not be of much value. It is more of a "global" wireless settings file that all wireless interfaces would inherit parameters from. While this might be useful in certain apps, I personally think it makes more sense to specify the wireless settings in rc.inet1.conf on a per-interface basis, just as you would for wired ethX connections. This allows you to specify unique settings for each wireless interface you may have on your system (useful if you have more than one). Thus, in my rc.wireless.conf I deleted all the provided examples and simply have the below.
# cat /etc/rc.d/rc.wireless.conf
VERBOSE=1
case "$HWADDR" in
# Generic example (decribe all possible settings)
*)
#INFO="Fill with your own settings..."
# ESSID (extended network name) : My Network, any
ESSID="SKY12345"
# NWID/Domain (cell identifier) : 89AB, 100, off
#NWID=""
# Operation mode : Ad-Hoc, Managed, Master, Repeater, Secondary, auto
#MODE=""
# Frequency or channel : 1, 2, 3 (channel) ; 2.422G, 2.46G (frequency)
#FREQ=""
#CHANNEL=""
# Sensitivity (cell size + roaming speed) : 1, 2, 3 ; -70 (dBm)
#SENS=""
# Bit rate : auto, 1M, 11M
#RATE=""
# Encryption key : 4567-89AB-CD, s:password
KEY="s:MYPASSPHRASE"
# RTS threshold : off, 500
#RTS=""
# Fragmentation threshold : off, 1000
#FRAG=""
# Other iwconfig parameters : power off, ap 01:23:45:67:89:AB
#IWCONFIG=""
# iwspy parameters : + 01:23:45:67:89:AB
#IWSPY=""
# iwpriv parameters : set_port 2, set_histo 50 60
#IWPRIV=""
;;
esac

Everything is commented out in the case statement, but I left the parameter names just incase down the road I ever need to use rc.wireless.conf.
The next step is the configuration of rc.inet1.conf and wpa_supplicant.conf.
rc.inet1.conf will allow us to specify the settings of each wired/wireless interface that is recognized by the output of

# ip link
The relevant (wireless) part of my rc.inet1.conf is as such:
# cat /etc/rc.d/rc.inet1.conf

IFNAME[4]="wlan0" <---- as shown by ifconfig and iwconfig
IPADDR[4]=""
NETMASK[4]=""
USE_DHCP[4]="yes"
WLAN_RATE[4]="54M auto"
WLAN_WPA[4]="wpa_supplicant"
WLAN_WPADRIVER[4]="wext"
The above should be sufficient for the majority of setups.

My advice is to use wpa_supplicant even if your AP does not use a key for access. The default wpa_supplicant.conf provides two network examples. The top (first) one is for an AP that requires a key and the second one is for an AP that does not (free public APs). I will focus my attention on the one that requires a key. Assuming your AP requires a key (most likely WPA-PSK w/ TKIP encryption), you first need to run

# wpa_passphrase essid-of-your-AP passphrase-of-your-AP  >> /etc/wpa_supplicant.conf

e.g.
# wpa_passphrase SKY12345 ABCD12345 >> /etc/wpa_supplicant.conf


This is to get a hexadecimal encryption key to be manually inserted into your wpa_supplicant.conf.



ASIDE: If you are clueless about some of the settings and capabilities of your AP, I suggest running

# iwlist wlan0 scan

If you get a message that the network is down, first type


# ifconfig wlan0 up

 This will show you all the APs that your card has detected, along with the essids, the encryption (if any) that they use, and the supported bit rates of that AP.

An example output of my personal wpa_supplicant.conf (edit, of course, for security reasons):

# cat /etc/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=wheel
eapol_version=1
ap_scan=1
fast_reauth=1
# WPA protected network, supply your own ESSID and WPAPSK here:
network={
scan_ssid=1
ssid="your-ssid-goes-here"
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
#group=CCMP TKIP WEP104 WEP40
#psk below was made with wpa_passphrase
psk=abcdef12345abcdef12345abcdef12345abcdef12345abcdef
}

That's about it! You can either do a full system reboot or run the rc.inet1 script as root. If you want to just run the script on the wlan0 interface, the proper command is 'rc.inet1 wlan0_start'.


for information and source: see

No comments:

Post a Comment

Post a Comment