Using the NDIS Wrapper Device Driver
Why do I need the NDIS Wrapper?
Some WireLess NIC adapters do not offer a Linux driver, but of course, they do have Windows device drivers. Some popular chipset vendors have not even released the specifications for their devices and that makes it impossible for the Linux community to develop Linux based device drivers. The Linux NDIS Wrapper allows one to use some Windows device drivers under Linux. If you have bought a wireless NIC and tossed it aside, or something more drastic, like reinstalled Windows on your laptop, read on to get your wireless NIC WarDriving.
What the heck is NDIS?
NDIS is the acronym for Network Device Interface Specification. The specification was originally developed by IBM, 3COM, Intel and Microsoft for MS-DOS based personal computers (MS-DOS 3.0). In the beginning, every network card manufacturer had to have their own special driver, which also limited a personal computer to having only one network card due to software conflicts. NDIS solved this problem by providing a software API or layer, between the protocol stack (network software such as TCP/IP) and the actual physical device. All of the low level hardware interaction with a network card was now performed in the NDIS driver such as DMA transfer's, interrupt service routines, etc. NDIS allows a network card to serve many protocols concurrently, such as IPX, TCP/IP, NetBEUI, Banyan and so on. Microsoft is up to version 5 of the NDIS specification and is documented heavily in the MS DDK.
What Do I Wrap with the Wrapper?
The NDIS Wrapper provides an environment in which a Microsoft NDIS 5 driver can function under Linux. The NDIS calls to the HAL and the NT kernel are translated into Linux compatible functions by the wrapper. It is truly a notable hack and shows that Linux programmers can overcome any obstacle. The wrapper comes in source format only. However, contributors have provided some binary packages. Mandrake 10 has the wrapper as part of their kernel listed under 3rd party drivers. The following chipsets are known to work (from the readme):
Broadcom (4301, 94306)
Intel Centrino (2100)
Admtek (8211)
Atheros (AR5004)
SMC2802 V2
3Com 3CRSHPW796
TI AC111
A more complete list can be found at the supported_chipsets page.
Compiling and Installing
NDIS Wrapper has its own sourceforge.net development page. The project home page has numerous links such as a faq and other binary package's that are available. If you are using a custom kernel, you will have to compile and install the driver package yourself, otherwise, you may be able download a binary package for your distro. I only noticed Debian and Red Hat binary package's, there could be more. The source package can be downloaded here. You will also need your Windows driver disk so that the Wrapper can install them for Linux use. Once you have downloaded the source package (the kernel source must be installed also) and have your Windows driver handy, use the following steps (your /lib/modules subdirectory may differ, depends on kernel version):
tar zxvf ndiswrapper-0.7.tar.gz
cd ndiswrapper-0.7
su (log in as root)
make install
verify the driver was installed:
ll /lib/modules/YourKernel/misc/
-rw-r--r-- 1 root root 65764 May 6 13:38 ndiswrapper.ko
verify the utils were installed:
/usr/sbin/ndiswrapper -i
This will create a subdirectory in your /etc subdirectory named "ndiswrapper" with a copy of your Windows driver. I copied my Windows driver files over to my home subdirectory for future use. So i used: "/usr/sbin/ndiswrapper -i /home/robertt/airlink/bcmwl5.inf"
verify your Windows driver was installed:
I have provided a log of my compile for your reference.
Bringing Up your NIC
The Wrapper and Windows drivers along with the utils, should now be installed and ready to use. Next we need to bring up the NIC with the wireless LAN utils provided by your distro. First, lets load the Wrapper driver by issuing the command:
/sbin/modprobe ndiswrapper
Check your message log by using dmesg. An entry should appear like the following:
divert: allocating divert_blk for wlan0
wlan0: ndiswrapper ethernet device 00:90:96:68:6e:67 using driver bcmwl5.sys
Boy howdy, if you are this far, you will soon be WarDriving! Issuing the command /sbin/iwconfig should show an output similar to the one the below (the one shown is already configured):
lo no wireless extensions.
eth0 no wireless extensions.
wlan0 IEEE 802.11g ESSID:"11g AP" Nickname:"MobileRob"
Mode:Managed Frequency:2.452GHz Access Point: 00:90:96:64:75:B5
Bit Rate=48Mb/s Tx-Power:13 dBm
RTS thr=2347 B Fragment thr=2346 B
Power Management:off
Link Quality:100/100 Signal level:-41 dBm Noise level:-256 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:66133 Invalid misc:4260128 Missed beacon:0
You can have your NIC detected at boot by issuing the command /usr/sbin/ndiswrapper -m. This will modify your /etc/modprobe.conf by adding the following the line: alias wlan0 ndiswrapper. The rest of the setup procedure is distribution specific. Some information you will need is the ESSID of your network, type of network, Ad-hoc or Managed. Although the rest of this HowTO is Fedora Core specific, you may still find useful tidbits in setting up your NIC with other distro's. The INSTALL document contained in the ndiswrapper package also has some examples of configuring your NIC manually. The commands are very useful in testing out different parameters of your wireless LAN.
Fedora Core Setup
Your /etc/modprobe.conf should contain an alias for wlan0. Next we need to create the network config file that Fedora uses. For a head start, just download my ifcfg-wlan0, and place it in: /etc/sysconfig/network-scripts. The config file will have to be edited to match your particular wireless LAN configuration. You will need access to your wireless router or access point for the information that is missing in your configuration file. Check out the snapshot's of my access point.

Even though my network is "open", I only allow certain MAC addresses to connect. I was running WEP, but the Windows machines kept dropping off the network until I switched to "open".

Once you have setup the ifcfg-wlan0, run the following command: /usr/bin/system-config-network. From the task bar, its System Settings->Network. If you have already modprobe'd, you should be able to "Activate" your NIC, or just reboot. Your "Network Configuration" with Fedora Core should resemble the snapshot's as shown below:


For questions and answers use the forum.
Hardware and Software Configuration Used:
Fedora Core 2 Test 3
Dell Inspiron 5100 Laptop
AirLink+ 802.11g - WLH3010 - PCMCIA Adapter
My book recommendations:
Excellent instructions!!
Submitted by Anonymous on Tue, 09/18/2007 - 02:12.Thanks heaps for this, this tutorial has worked on my laptop ans nothing else seemed to work,
Thanks,
Daniel