When your favorite wireless app is not working

Nowdays, all laptops have wifi cards, and if you have an old laptop you can buy a pcmpcia card,or you can try a USB wifi card ( TL-WN321G)

In linux, you have a lot of wifi manager apps.You can read more about them here

But sometimes none of them are working and it's impossible to connect to a free public AP.So, back to the console :)


1- Free AP

- to scan for wireless AP

in my case, ath0 is the wifi card (i'm using a smc card with atheros chipset, Atheros Communications, Inc. AR5212 802.11abg NIC)

iwlist ath0 scanning


the result of wifi scanning myust be something like this :


ath0 Scan completed :
Cell 01 - Address: 00:00:00:00:00:00
ESSID:"free host spot"
Mode:Master
Frequency:2.437 GHz (Channel 6)
Quality=45/70 Signal level=-50 dBm Noise level=-95 dBm


to connect to this hot spot type : iwconfig ethX essid "free hot spot"

In order to check if you are connected to the "free hot spot" ap run: iwconfig ath0

The result must be like this:
ath0 IEEE 802.11g ESSID:"free hot spot" Nickname:""
Mode:Managed Frequency:2.437 GHz Access Point: 00:00:00:00:00:00
Bit Rate=54 Mb/s Tx-Power:11 dBm Sensitivity=1/1
Retry:off RTS thr:off Fragment thr:off

[...]

if the output is something like this, you are ok to go online.

To optain the ip, run: dhclient ath0

And that's all.


2- Encrypted AP.


iwlist ath0 scanning will output something like this:


ath0 Scan completed :
Cell 01 - Address: 00:00:00:00:00:00
ESSID:"free host spot"
Mode:Master
Frequency:2.437 GHz (Channel 6)
Quality=44/70 Signal level=-51 dBm Noise level=-95 dBm
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
12 Mb/s; 24 Mb/s; 36 Mb/s; 9 Mb/s; 18 Mb/s
48 Mb/s; 54 Mb/s
Extra:bcn_int=100
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
Extra:ath_ie=dd0900016f0201001dff7f






If the AP on wich you are connected is using WPA/PSK, then you must use wpa_supplicant

And If you have the key ;)

wpa_passphrase "free hot spot" password

this will output something like this:


network={
ssid="free hot spot"
#psk="password"
psk=ae818df577977c6fd073040812f949efe89919c52062fb18f6731227423d7bb0
}



After this create a file named, wpa_supplicant.conf

echo >> wpa_supplicant.conf


ctrl_interface=/var/run/wpa_supplicant # wpa_supplicant keep its
process ID number here
ctrl_interface_group=your_user_name
network={
ssid="free hot spot"
#psk="password"
key_mgmt=WPA-PSK
proto=WPA
psk=ae818df577977c6fd073040812f949efe89919c52062fb18f6731227423d7bb0
}



to connect to the AP, type from root account

wpa_supplicant -B w -D madwifi -i
ath0 -c wpa_supplicant.conf


Change the -D madwifi according to your wifi card driver.For more info read the man page of wpa_supplicant.

[...]

drivers:
hostap = Host AP driver (Intersil Prism2/2.5/3)
dscape = Devicescape driver
prism54 = Prism54.org driver (Intersil Prism GT/Duette/Indigo)
madwifi = MADWIFI 802.11 support (Atheros, etc.)
atmel = ATMEL AT76C5XXx (USB, PCMCIA)
wext = Linux wireless extensions (generic)
ndiswrapper = Linux ndiswrapper
wired = wpa_supplicant wired Ethernet driver


[...]

Ofcourse, dhclient ath0

Happy browsing :)

Comments

Popular posts from this blog

Why sometimes oracle 10g XE sucks big time

NAT in opensolaris

Review of Yashica ML 50mm F2