Technetra

Wireless networking using NDIS Wrapper

Nilayan Sharma,  July 27th, 2004 at 1:25 pm

A few weeks ago, I decided to upgrade my existing 802.11b network with the latest 802.11g (54 Mbps) hardware. My network consists of two desktops, both using PCI (peripheral component interface) wireless adapters (WPM11), one notebook using a PCMCIA wireless adapter (WPC11), and a router/access point WRT11). All the wireless components are from Linksys because drivers from the Linux-WLAN project supported their chipsets in Linux. Both desktops and the notebook run Fedora Core 2 with a stock 2.6.5 kernel. Before upgrading to Fedora, I was running Red Hat Linux 9.0 with a 2.4.26 kernel on all three systems. Owing to a trouble-free experience with my current Linksys hardware, I decided to stick with them for my upgrade, too. I purchased two PCI adapters (WMP54Gv2), one PCMCIA adapter WPC54G), and an access point/router (WRT54G).

When 802.11b devices were initially released in the market, finding Linux support for them wasn’t easy. Chipset manufacturers were reluctant to share hardware specifications with the Linux community, fearing a loss of their “competitive advantage”. But, through the efforts of the chipset manufacturers and the Linux developer community, support for wireless networking devices in Linux has dramatically improved. Unfortunately, hardware vendors, like Linksys and Netgear, continue to provide device drivers for Windows only. The NDIS Wrapper project aims at bridging this gap by providing a kernel module to load Windows NDIS device drivers for unsupported hardware.

What is NDIS Wrapper?

NDIS Wrapper allows the Linux kernel to interact with a network device using the Microsoft NDIS driver for that device. NDIS Wrapper translates calls to the Windows NT kernel and hardware abstraction layer into native Linux calls. The project was started in November 2003 by the primary developers, Pontus Fuchs and Giridhar Pemmasani.

The Network Device Interface Specification (NDIS) was jointly developed by Microsoft and 3Com in the days of MSDOS to provide a device-driver programming interface allowing multiple network protocols to share the same network device. Before NDIS existed, hardware vendors provided proprietary drivers for their devices, creating interoperability issues for users.

Using NDIS Wrapper

Getting started with NDIS Wrapper is fairly straightforward. First, you have to install the unsupported network device in your Linux system. Next, download the NDIS Wrapper source package from the project’s homepage at ndiswrapper.sourceforge.net. If you are not using a custom kernel, you may be able to save time by using one of the precompiled NDIS Wrapper binary packages that are available for Red Hat and Debian (NDIS Wrapper is provided as part of Mandrakelinux 10). However, if you are using a custom kernel, you will need to have the source tree available for that kernel to compile NDIS Wrapper.

Once you have downloaded the source or binary NDIS Wrapper package, you will need to get the Windows driver for your network device. Generally, it comes on a CD with your hardware; otherwise you will need to download it from the vendor s website. Now that you have both NDIS Wrapper and the Windows drivers, we can get started with the installation. Just follow these steps:

Compile and install

Unpack the source package…

> tar xzvf ndiswrapper-0.8-rc2.tar.gz
> cd ndiswrapper-0.8-rc2

Login as “root”…

> make install

Verify installation of kernel module…

> ls -l /lib/modules/`uname -r`/misc/
-rw-r r  1 root root 1342995 Jun 1 17:52 ndiswrapper.ko

Verify the installation of user space utilities…

> whereis ndiswrapper loadndisdriver wlan_radio_averatec_5110hx
ndiswrapper: /usr/sbin/ndiswrapper
loadndisdriver: /sbin/loadndisdriver
wlan_radio_averatec_5110hx: /usr/sbin/wlan_radio_averatec_5110hx

Install Windows driver

Unpack the Windows driver package…

> unzip wmp54g_driver_utility_v1.3.zip

Install the driver…

> ndiswrapper -i BCMWL5.INF
Installing bcmwl5
(Note: This will also create the directory: /etc/ndiswrapper)

Verify the installation of the Windows driver…

> ndiswrapper -l
Installed ndis drivers:
bcmwl5    present

Enable the wireless network interface

Load the NDIS Wrapper kernel module…

> modprobe ndiswrapper

Verify device recognition by NDIS Wrapper…

> dmesg
ndiswrapper version 0.8-rc2 loaded ndiswrapper adding bcmwl5.sys
divert: allocating divert_blk for wlan0
wlan0: ndiswrapper ethernet device 00:0c:41:65:8f:f9   using driver bcmwl5.sys

Verify network configuration…

> iwconfig
lo     no wireless extensions.
eth0   no wireless extensions.
wlan0  IEEE 802.11g ESSID:""
       Mode:Managed Frequency:2.462GHz
       Access Point: FF:FF:FF:FF:FF:FF
       Bit Rate:54Mb/s Tx-Power:16 dBm
       RTS thr:2347 B Fragment thr:2346 B
       Encryption key:off
       Power Management:off
       Link Quality:100/100 Signal level:-10 dBm Noise level:-256 dBm
       Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
       Tx excessive retries:0 Invalid misc:122 Missed beacon:0

Set up automatic detection of the wireless device at system boot…

> ndiswrapper -m
Adding "alias wlan0 ndiswrapper" to /etc/modprobe.conf

Configure the wireless network interface in Fedora

Before you configure the network interface, you will need to know the service set identifier (SSID) and the mode (Ad-hoc, Managed) of your wireless network. If you don t have this information available, take a look at the configuration screens of your wireless access point.

Create the wlan0 configuration file using your favourite text editor…

> vi /etc/sysconfig/network-scripts/ifcfg-wlan0

Add the following lines to the file (lines in red will vary according to your configuration)…

# NDIS Wrapper Configuration: Linksys
WMP54GDEVICE=wlan0
ONBOOT=yes
BOOTPROTO=static
TYPE=Wireless
MODE=Managed
ESSID="marin"
CHANNEL=11
IPADDR=192.168.0.210
DOMAIN=private.dom
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
USERCTL=no
PEERDNS=no
IPV6INIT=RATE=Auto
HWADDR=00:0C:41:65:8F:F9

Save the file and use the “System Settings” -> “Network” control panel to activate the interface

Verify wireless connectivity

> iwconfig wlan0
wlan0  IEEE 802.11g ESSID:"marin"  Nickname: owl.private.dom
       Mode:Managed Frequency:2.462GHz
       Access Point: 00:0F:66:51:06:70
       Bit Rate=54Mb/s
       Encryption key:off
       Link Quality:0/100 Signal level:-47 dBm Noise level:-256 dBm
       Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
       Tx excessive retries:0 Invalid misc:0 Missed beacon:0

> ifconfig wlan0
wlan0  Link encap:Ethernet HWaddr 00:0C:41:65:8F:F9
       inet addr:192.168.0.210 Bcast:192.168.0.255 Mask:255.255.255.0
       inet6 addr: fe80::200:0c41:fe65:8ff9/64 Scope:Link
       UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
       RX packets:1558941 errors:0 dropped:0 overruns:0 frame:0
       TX packets:825302 errors:0 dropped:0 overruns:0 carrier:0
       collisions:0 txqueuelen:1000
       RX bytes:2305901954 (2199.0 Mb) TX bytes:143025599 (136.3 Mb)
       Interrupt:11 Memory:de000000-de00ffff

Try to ping www.google.com...

> ping -c 1 www.google.com
PING www.google.akadns.net (216.239.57.99) 56(84) bytes of data.
64 bytes from 216.239.57.99: icmp_seq=0 ttl=240 time=29.6 ms

--- www.google.akadns.net ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 29.622/29.622/29.622/0.000 ms, pipe 2

Finally, surf the Web…

Conclusion

As Linux gains popularity on the desktop, my hope is that hardware vendors will make a better effort to support their customers by releasing native device drivers. Meanwhile, we should thank the developers behind NDIS Wrapper for a job well done!

© Nilayan Sharma, Technetra. Published July 2004 in LinuxForYou magazine. This work is licensed under a Creative Commons Attribution-No Derivative Works 3.0 License. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

When Stars Move Article Index Piracy: Friend or Foe?

Comments

One Response to “Wireless networking using NDIS Wrapper”

  1. December 21st, 2006 at 10:01 pm (Comment)
    Duncan Says:

    This is a useful article, and I’ve found similar information on the ndiswrapper project site, but I wish someone would address how to fully integrate an ndiswrapper wireless driver into Fedora’s network configuration scripts and tools. Not only would it be really nice to be able to configure the wireless card settings via the GUI, but the above settings assume that the wireless card will be given a static IP address. Integration with the dhcp client daemon is trickier.

© 2000-2010 Technetra. All rights reserved. Contact | Terms of Use

WordPress