Showing posts with label wireless. Show all posts
Showing posts with label wireless. Show all posts

Monday, December 28, 2009

Linux: To Compile wpa_supplicant on Debian 3.1 Sarge

I was using good old Debian Linux 3.1 Sarge when I found out Sarge's wpasupplicant couldn't work well with ndiswrapper-supported Windows network drivers. So I set out to compile wpa_supplicant on my own. First, I installed the following development packages.



  • gcc-3.4
  • libssl0.9.7
  • make


Then, I downloaded the wpa_supplicant source (wpa_supplicant-0.6.9.tar.gz) from http://hostap.epitest.fi/wpa_supplicant. I unpacked the source and read the README files.



tar xzvf wpa_supplicant-0.6.9.tar.gz
cd wpa_supplicant-0.6.9/wpa_supplicant


I went into the wpa_supplicant subfolder and created .config to customize my build. The following is the contents of my .config:



CONFIG_WIRELESS_EXTENSION=y
CONFIG_DRIVER_HOSTAP=y
CONFIG_DRIVER_ATMEL=y
CONFIG_DRIVER_WEXT=y
CONFIG_DRIVER_RALINK=y
CONFIG_DRIVER_NDISWRAPPER=y
CONFIG_DRIVER_IPW=y
CONFIG_IEEE8021X_EAPOL=y
CONFIG_EAP_MD5=y
CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_TLS=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_GTC=y
CONFIG_EAP_OTP=y
CONFIG_EAP_SIM=y
CONFIG_EAP_AKA=y
CONFIG_EAP_PSK=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_PAX=y
CONFIG_EAP_LEAP=y
CONFIG_EAP_IKEV2=y
CONFIG_EAP=y
CONFIG_WPS=y


Then, I began compilation by running make.


make


The compilation was successful. I installed wpa_supplicant with the following command.



make install


The following files are copied to the system.



/usr/local/sbin/wpa_supplicant
/usr/local/sbin/wpa_passphrase
/usr/local/sbin/wpa_cli

Sunday, October 11, 2009

Linux: Atheros AR9285 Driver for Toshiba NB205

My Toshiba netbook NB205 was pre-installed with Windows XP. After extensive manipulation of partitions, the original Windows XP installation was gone. I booted my old Linux from a USB thumb drive but couldn't go online for lack of a Linux driver for the built-in Atheros AR9285 wireless card. So I looked for the AR9285 Windows driver because my Linux kernel has ndiswrapper support. I found a working driver (x600_wlan785_x_nb.zip) at the MSI support site.



After I downloaded x600_wlan785_x_nb.zip, I unzipped it. A new directory XP_7.7.0.348_20090701 is created.


unzip x600_wlan785_x_nb.zip

There you'll find two drivers, athw.sys and athwx.sys. Go to the ndis5x directory.


cd XP_7.7.0.348_20090701/ndis5x/

Install the Windows driver to be used with ndiswrapper.


ndiswrapper -i netathw.inf

The ndiswrapper tool will copy the Windows driver to a folder in /etc/ndiswrapper. To check your ndiswrapper installation, run the following command:


ndiswrapper -l

If you haven't, load the ndiswrapper kernel module.


modprobe ndiswrapper

Then, use your favorite Wireless configuration tool to connect to your wireless network.

Friday, July 10, 2009

Vista: Sharing Wireless Internet Connection with Ad-Hoc Network

Wireless networks are so common today. Yet, one shortcoming of wireless networks is that sometimes the signal from the access point (a.k.a wireless router) cannot reach all your computers due to various reasons, such as a physical obstacle or interfering signals. In such cases, we can set up a computer in reach of the access point to act as a gateway to out-of-reach computers in an ad-hoc wireless network. Then, Internet Connection Sharing feature of Windows Vista will be used to extend your wireless network. Let's assume we have computer A within the range of a wireless router, therefore can access the Internet. Also, we have computer B that's near computer A but too far from the wireless router.


WirelessBridge

To help computer B access the Internet, we need 2 wireless adapters for computer A and one for computer B. Now, set up computer A to access the Internet via wireless router as usual.


Vista Control Panel Network and Sharing Center

At the same time, with the extra wireless adapters, set up an ad-hoc wireless network between computer A and computer B. To do so, select Set up a connection or network in the left side of the Network and Sharing Center (See the picture above). This brings up the following window. Select Set up a wireless ad-hoc (computer-to-computer) network and click Next.


net03

Choose the secondary wireless network connection of Computer A that will be used to communicate with computer B.


net04

Set up a wireless ad-hoc network in the next windows.


net06

Don't choose Turn on Internet connection sharing yet.


net07

After you set up a wireless ad-hoc network, bring up the Network Connections window.


Vista Control Panel Network Connections

Right-click the primary wireless network connection and choose Properties. In the Sharing tab, enable Internet Connection Sharing as follows:


Internet Connection Sharing

Now, go to computer B and connect to the ad-hoc network you just created. In most cases, you'll be able to access the Internet. If not, bring up the Network Connections, right-click the Wireless Network Connection and select Properties in the right-click menu.


net12

In the Network Properties window, select Internet Protocol Version 4 (TCP/IPv4) and click Properties.


net13

In case computer B still can't access the Internet, manually set up its connection like this:


net14

Thursday, April 23, 2009

Linux: Connecting to Wireless Networks with wpa_supplicant

Connecting to a wireless network in Linux is easy with wpa_supplicant. If you haven't, install the wpasupplicant package first. Also, install wireless-tools.



Of course, the driver for the wireless adapter has to be installed and loaded too. You can either use Linux native driver or Windows NDIS driver for your wireless device. The Linux kernel itself provides native driver modules for popular wireless chips. Alternatively, you can use a Windows driver in Linux with the help of ndiswrapper. I prefer using ndiswrapper to enable my wireless adapters. Once ndiswrapper is configured correctly, the following command will load the driver for the wireless network adapter.



modprobe ndiswrapper


In order to be able to control wpasupplicant with wpa_cli and wpagui, you should add useself to the netdev group.


adduser username netdev

To automatically have wpasupplicant take care of wireless connections, you should edit two files, /etc/network/interfaces and /etc/wpa_supplicant/wpa_supplicant.conf. The following is a sample /etc/network/interfaces file.



auto lo wlan1

iface lo inet loopback

iface default inet dhcp

iface WPA_hidden inet static
address 192.168.1.250
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

iface wlan1 inet manual
wpa-driver wext
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf


Then, you need to create a configuration file /etc/wpa_supplicant/wpa_supplicant.conf. Its contents typically looks like this:



ap_scan=1
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

network={
ssid="MyWifiNet"
scan_ssid=1
key_mgmt=WPA-PSK
proto=WPA
pairwise=TKIP
group=TKIP
psk="WPA password"
id_str="WPA_hidden"
}

network={
ssid="linksys"
key_mgmt=NONE
wep_key0=e2c45314910abf72e871beda87
wep_tx_keyidx=0
}


In the example above, the ssid= and psk= lines should to be adjusted for each wireless network. The second nework linksys is an example of WEP networks. Next, run the following command to start a WPA connection to your wireless network.



wpa_supplicant -c /etc/wpa_supplicant.conf -i wlan1 -B


The steps below finalize wirless network setup.



ifconfig wlan0 192.168.1.201 up

route add default gw 192.168.1.1


Additionally, check the contents of /etc/resolv.conf which set up DNS servers.



To Kill WPA_supplicant


To terminate wpa_supplicant, execute wpa_cli and type the following commands:


terminate
quit

About This Blog

KBlog logo This blog is about current events and issues concerning general population. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

icon
Powered By Blogger