For roaming you can use iwlist to discover the SSID of any available networks eg (my interface is ra0)
Code:
bash-3.00# iwlist ra0 scan
ra0 Scan completed :
Cell 01 - Address: 00:30:F1:FF:6D:49
Mode:Managed
ESSID:"foundEssid"
Encryption key: on
Channel:11
Quality:64/100 Signal level:-195 dBm Noise level:-256 dBm
Then you can connect to foundEssid
Code:
iwconfig ra0 channel 0
iwconfig ra0 mode managed
iwconfig ra0 rate auto
iwconfig ra0 essid foundEssid
You will then want to use DHCP to get an IP address on the new network
Code:
dhcpcd -k ra0 # Kill old
dhcpcd -d -h $(hostname) ra0
I think WPA support depends on the hardware and driver combination. I use a native driver. My wireless card suports WPA in hardware and is configured using the private interface iwpriv.
Code:
iwpriv ra0 set AuthMode=WPAPSK
iwpriv ra0 set EncrypType=TKIP
iwpriv ra0 set WPAPSK="password"
If you are using the ndiswrapper or you hardware does not support WPA, you will need to configure the wpa_supplicant