On 01/17/2010 06:48 AM, Josef Wolf wrote:
Can you give me an example how to properly configure multiple (known) AP's so that they can be changed on-the-fly?
Be glad to Joseph, Both my Toshiba laptops use Atheros cards so that means they use the madwifi driver and wpa_supplicant for TKIP encryption. Virtually every wireless chipset/driver combinations have the same capabilities. You just have to confirm the name and location of your config files. You may even be using wpa_supplicant for handling wireless security for your chipset. Using traditional ifup or network manager, configuration for which AP to connect to and the credentials is handled exactly the same and in the same file. In my case it is: /etc/wpa_supplicant/wpa_supplicant.conf (some distros use: /etc/wpa_supplicant.conf) To configure to connect to your APs on the fly you simply add a separate 'network block' to your wpa_supplicant.conf and assign a priority to the 'network block' to determine which one it tried first, etc.. For my wireless use, I have basically 3 networks I normally connect to (1) home, (2) work, and (3) lake. So the 3 netblocks in my wpa_supplicant look like this: # skyline network={ ssid="skyline" priority=6 key_mgmt=WPA-PSK proto=RSN # psk="mypwd" psk=660d3d<big-snip>3b698b13b569bf2c } # work network={ ssid="rbpllc" # psk="mypwd" psk=27218b86b5e<big-snip>3b692affb3a5 } # lakehouse network={ ssid="lakehouse" # priority=2 # key_mgmt=WPA-PSK # proto=RSN # psk="mypwd" psk=8d77d14af1f0ed<big-snip>3b6945178d25 } So above, when connecting it tries home first, if home isn't available, it tries the other 2 in the order shown. (note the other priorities are commented out from prior changes I made to the file). If I ever need to connect to another network, then I just open a console and in 12 seconds using the commands in the original repy, I have a new connection. (Ok,ok, if I have to crack WEP add another 6 seconds ;-)
Yeah, but where do I go from here? Google finds me lots of contradictory information about wlan configuration. I guess I have to use wpa-supplicant for WPA2-AES?
wpa_supplicant is your friend! It is simple and bulletproof. You already have all the info you need. The best 2 wpa documents are: /usr/share/doc/packages/wpa_supplicant/README /usr/share/doc/packages/wpa_supplicant/examples/wpa-psk-tkip.conf I didn't believe it either, but the package documentation actually provided "useful" information. I have a wireless cheat sheet I've posted before that may help. Let's see... I love basket notepads! If you don't use it, open yast and install 'basket'. You will wonder how you every lived without it! Anyway: Basics - Creating and Confirming the wireless device # Check that ath0 station is created: iwconfig lo no wireless extensions. wifi0 no wireless extensions. ath0 IEEE 802.11g ESSID:"rbpllc" Nickname:"" Mode:Managed Frequency:2.412 GHz Access Point: 00:1C:10:4B:2E:CD Bit Rate:48 Mb/s Tx-Power:16 dBm Sensitivity=1/1 Retry:off RTS thr:off Fragment thr:off Encryption key:6B2E-5834-1B7A-1BA3-FDAA-484B-6E84-3B55 Security mode:restricted Power Management:off Link Quality=44/70 Signal level=-48 dBm Noise level=-92 dBm Rx invalid nwid:12662 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 eth0 no wireless extensions. # if NO ath0, then Create the station wlanconfig ath0 create wlandev wifi0 wlanmode sta ** Note wifi0 is just a placeholder for the actual device ath0 # Check that the station is created iwconfig: iwconfig # Bring up the interface: ifconfig ath0 up # Insert the scanning module: modprobe wlan_scan_sta # Scan for wireless networks: wlanconfig ath0 list scan For additional information: iwlist ath0 scan # set the operating mode (Managed or Ad-Hoc) iwconfig ath0 mode Managed # set the frequency or channel iwconfig ath0 channel 3 # if key required iwconfig ath0 key <yourkey> # check your current keys wlanconfig ath0 list keys # Connect to the AP iwconfig ath0 essid "eddie" iwconfig ath0 key s:password # for ASCII key entry iwconfig ath0 key restricted [3] 0123456789 # sets mode and uses key index 3 # Get IP address dhclient ath0 or dhcpcd ath0 # For fixed IP ifconfig ath0 <IP address> netmask <netmask> up # To set up WPA config wpa_passphrase "your_ESSID" "PassPhrase_up-to-64-Characters" \ >> /etc/wpa_supplicant.conf Edit /etc/wpa_supplicant.conf and add the lines into the network section created above: key_mgmt=WPA-PSK # proto=WPA proto=RSN Uncomment the proto=WPA line (and comment out the RSN line) to enable WPA. Leave as is for WPA2 (stronger encryption). Starting wpa_supplicant wpa_supplicant -Bw -i ath0 -c /etc/wpa_supplicant/wpa_supplicant.conf -f /var/log/wpa_supplicant.log Getting the address dhclient ath0 # as root -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org