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
                    Protocol:IEEE 802.11g
                    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
                    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
$ gksudo vi /etc/wpa_supplicant.conf
Append configuration as follows:


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
$ gksudo vi /etc/wpa_supplicant.conf
Append configuration as follows:

        pairwise=CCMP TKIP
        group=CCMP TKIP

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:

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

How to Make Website WCAG Compliant?

Next Post

Link download Kali Linux 2020.1 (ISO + Torrent)

Related Posts