Ubuntu Linux Install and Configure Ndiswrapper and wpa_supplicant
Q. How do I install NdisWrapper and wpa_supplicant under Ubuntu Linux?
A. NdisWrapper is a free software driver wrapper that enables the use of Microsoft Windows drivers for wireless network devices such as PCI cards, USB modems on Linux / Unix-like operating systems.
Ndiswrapper works by implementing the Windows kernel and NDIS APIs, and dynamically linking the driver to this implementation.
You need to install following softwares:
- ndiswrapper-common : Common scripts required to use the utilities
- ndiswrapper-utils : Userspace utilities for the ndiswrapper linux
Step # 1: Download and install ndiswrapper
You can download .deb ndiswrapper packages here
Alternatively, you can install the same using apt-get command:
$ apt-cache search ndiswrapper-utils
Output (note version number 1.9):
ndiswrapper-utils-1.9 - Userspace utilities for the ndiswrapper linux kernel module
Now install it:
$ sudo apt-get install ndiswrapper-common ndiswrapper-utils-1.9
Step # 2: Copy .INF and .SYS files
You need to copy .INF and .SYS files from CD / floppy disk provided with your device. You can also obtain driver from manufactures web site.
Step # 3: Install Driver
To install driver, enter:
$ sudo ndiswrapper -i driver-name.inf
Verify that driver was installed:
$ ndiswrapper -l
Finally, install ndiswrapper driver
$ sudo modprobe ndiswrapper
Step # 4: Verify wireless interface
Use iwconfig to see your wireless interface:
$ iwconfig
Sample output:
lo no wireless extensions.
eth0 no wireless extensions.
wlan0 IEEE 802.11g ESSID:"payalhome"
Mode:Managed Frequency:2.462 GHz Access Point: 00:1B:2F:A3:4C:9A
Bit Rate=54 Mb/s Sensitivity=-200 dBm
RTS thr=2346 B Fragment thr=2346 B
Power Management:off
Link Quality:29/100 Signal level:-77 dBm Noise level:-96 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
Make sure your driver get loaded each time you boot your computer:
$ sudo ndiswrapper -m
Step # 5: Install wpa_supplicant
Wireless networks do not require physical access to the network equipment in the same way as wired networks. This makes it easier for unauthorized users to passively monitor a network and capture all transmitted frames. In addition, unauthorized use of the network is much easier. In many cases, this can happen even without user’s explicit knowledge since the wireless LAN adapter may have been configured to automatically join any available network. So configure your wireless router for WPA or WPA2 security (refer router documentation for more information).
wpa_supplicant is Wi-Fi Protected Access client and can be install by entering following command:
$ sudo apt-get install wpasupplicant wpagui
- /etc/wpa_supplicant.conf - Default configuration file
Scan your network
Type the following command to scan your network
$ iwlist wlan0 scan
Sample output:
wlan0 Scan completed :
Cell 01 - Address: 00:1A:2F:A4:4C:9A
ESSID:"payalhome"
Protocol:IEEE 802.11g
Mode:Managed
Frequency:2.462 GHz (Channel 11)
Quality:37/100 Signal level:-72 dBm Noise level:-96 dBm
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
48 Mb/s; 54 Mb/s
Extra:bcn_int=100
Extra:atim=0
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : WEP-40
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
IE: WPA Version 1
Group Cipher : WEP-40
Pairwise Ciphers (1) : WEP-40
Authentication Suites (1) : PSK
Step # 6a: Configure Wireless card for WPA authentication
Open /etc/wpa_supplicant.conf file:
$ gksudo gedit /etc/wpa_supplicant.conf
OR
$ gksudo vi /etc/wpa_supplicant.conf
Append configuration as follows:
network={
ssid="YOUR-NETWORK-ESSID"
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP
psk="YOUR-PASSWORD"
}
Save and close the file.
Step # 6b: Configure Wireless card for WPA2 authentication
Open /etc/wpa_supplicant.conf file:
$ gksudo gedit /etc/wpa_supplicant.conf
OR
$ gksudo vi /etc/wpa_supplicant.conf
Append configuration as follows:
network={
ssid="YOUR-NETWORK-ESSID"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="YOUR-PASSWORD"
}
Save and close the file.
Connect to network
Type the following command:
$ sudo wpa_supplicant -d -c/etc/wpa_supplicant.conf -iDEVICE-NAME -Dwext
If your device name is wlan0, enter:
$ sudo wpa_supplicant -d -c/etc/wpa_supplicant.conf -iwlan0 -Dwext
Assign IP address
Finally, you need to assign IP address using DHCP server built into wireless router, simply enter two commands:
$ sudo ifconfig wireless-interface up
$ sudo dhclient wireless-interface
$ host google.com
$ ping nixcraft.com
If your device name is wlan0, enter:
$ sudo ifconfig wlan0 up
$ sudo dhclient wlan0
If every thing works as expected, you can start wpa_supplicant without -d option i.e replace -d by -B for the deamon mode:
$ sudo wpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0 -Dwext
Further readings:
- man pages - wpa_supplicant, wpa_supplicant.conf, iwconfig, iwscan, ping, host
- ndiswrapper project
- wpa_supplicant project
- Ultimate Linux desktop operating system
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Linux / UNIX FAQ:
- Linux Install and Configure Netgear WG311 Marvell 88w8335 Rev 03 Chipset Wireless Card
- You need to have the Linux kernel source installed for this driver
- Enable Linux dual core CPU support for my Server
- Linux set date and time from command prompt
- Upgrade Linux kernel howto
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!
Tags: /etc/wpa_supplicant.conf, access point, bit rate, host command, iwconfig command, iwscan command, linux kernel, ndis, ndiswrapper linux, noise level, pci cards, ping command, power management, software driver, sys files, Ubuntu Linux, windows drivers, windows kernel, wireless extensions, wireless interface ~ Last updated on: April 24, 2008



April 24th, 2008 (3 weeks ago) at 7:03 am
Great Post!
—————
-= FErArg =-
http://www.FErArg.com
—————