Netgear WG111 on Debian with NDISWrapper and WPA
Over the weekend my trusty wireless switch / bridge (Netgear WGP606) gave up on me and decided not to feed my wireless network to its 4 port switch. I relied heavily on this as it supplied the internet to a small lan that I have set up in my office, and a MythTV box which lives in my bedroom. I can’t live without this so I needed a plan…
My plan was to use my spare WG111 dongle that I used to use on my MythTV box. My idea was to connect this to my debian(etch) server and bridge it with the current ethernet interface, and then feed that to a port on the WGP606, as it was still working as a switch.
I had heard rumours that setting up wireless network devices on debian was quite difficult and would take some time, but I’m always up for a challenge. Setting this same device up on my MythTV box was a cinch. Its running Ubuntu Hardy and was easy as plugging it in – and it worked out of the box. Note: I was not expecting it to be that easy under Debian.
Below are the steps I followed to get this working. Working out these steps took me around 4 hours of research, but it should take no longer than 30 mins to setup if you follow them step by step.
Step 1: Plug the WG111 into a spare USB port and verify that debian has recognised it by executing the following command.
lsusb
You should get the following output, or something like it.
Bus 003 Device 002: ID 0000:0000 NetGear, Inc. WG111 WiFi (v2) Bus 003 Device 001: ID 0000:0000 Bus 001 Device 001: ID 0000:0000 Bus 002 Device 001: ID 0000:0000
If you get this far great you may continue. If your dongle isn’t recognised then you have a bigger problem which is not in the scope of this article. I’m no Linux guru, but I may be able to help you so just drop me a comment and I’ll see what I can do!
Step 2: Install the appropriate packages
sudo apt-get install module-assistant ndiswrapper-utils
Step 3: Prepare and build the NDISWrapper Module.
Execute the following commands in order as root or using sudo.
m-a prepare m-a a-i ndiswrapper modprobe ndiswrapper
Step 4: Blacklist any confilicting drivers.
Add the following to /etc/modprope.d/blacklist
blacklist islsm_pci
blacklist islsm
blacklist islsm_usb
blacklist prism2_usb
blacklist rtl8187
blacklist r8187b
Step 5: Get the windows WG111 driver
Download the Netgear 1.3 driver from here http://kbserver.netgear.com/release_notes/D102843.asp
and unzip it to your home directory or any directory you have access to.
Step 6: Install the driver and verify its installation
sudo ndiswrapper -i [path to driver]/win98/net111v2.inf
You will need to install the Windows 98 version of the driver.
No check that it installed correctly.
ndiswrapper -l
You should see something like this:
net111v2 : driver installed device (0846:6A00) present
Step 7: Load Module at startup
sudo ndiswrapper -m
No add the word “ndiswrapper” (without the quotes) to /etc/modules
Step 8: Setup the network interface
Below is a copy of my interfaces file. Obviously replace your device name (mine is wlan0) and enter your correct essid, and ip addresses.
auto lo wlan0
iface lo inet loopback
iface wlan0 inet static
address 192.168.0.50
netmask 255.255.255.0
network 192.168.0.0
gateway 192.168.0.1
broadcast 192.168.0.255
wireless-essid ########
wireless-mode managed
wireless channel 11
You can change static to dhcp if you wish.
Ok if you reboot at this stage, you should have the ndiswrapper module load on boot and you should have a working wireless dongle, albeit insecure. if you type the following command as root it should give you some details of your wireless connection. (bare in mind we haven’t set up wpa yet so if your wireless AP or router is protected by WPA you still wont have a connection)
iwconfig
You should see something like this;
wlan0 IEEE 802.11g ESSID:"#######"
Mode:Managed Frequency:2.462 GHz Access Point: ##:##:##:##:##:##
Bit Rate=54 Mb/s Tx-Power:20 dBm Sensitivity=0/3
RTS thr:off Fragment thr:off
Encryption key:########
Security mode:restricted
Power Management:off
Link Quality:42/100 Signal level:-69 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
I’ve masked out my essid and mac address, and also my encryption key. At this stage you won’t have an encryption key, and as stated before you probably won’t see your essid if it has WPA protection, as we have not set this up yet. Getting some information from this command tells us that the module and the driver have loaded correctly and we can continue with our setup.
Step 9: Setup WPA
For WPA we are going to use the wpasupplicant package.
sudo apt-get install wpasupplicant
Create the file /etc/default/wpasupplicant and add the following lines replacing wlan0 with your device
ENABLED=1
OPTIONS=”-w -i wlan0 -D ndiswrapper -c /etc/wpa_supplicant.conf”
Now lets create a hex of your key. Execute the following;
wpa_passphrase 'your_essid' 'your_ascii_key'
You should get something like this;
network={
ssid="####"
#psk="your ascii key"
psk=your hex key
}
Now create the file /etc/wpa_supplicant.conf and copy the above output into it, but also add the following lines. Be sure everything stays within the braces ({});
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
Now lets re-open /etc/network/interfaces and add the following lines:
wpa-driver wext
wpa-conf /etc/wpa_supplicant.conf
Ok we should be good to go now, lets re-start the network
/etc/ini.d/networking restart
voila – you will now be connected to the wireless network, check both iwconfig and ifconfig commands as root. If everything is working go back to /etc/wpa_supplicant.conf and remove the line that displays a copy of your ascii passphrase!
If you’re not interested in bridging your wireless and wired devices then you are done, and your debian box should be connected to your wireless network. However, I needed to get my lan back online!! so lets start configuring the bridge.
Step 10: Setup the network bridge
To set up a bridge you first need to install the correct package;
apt-get install bridge-utils
First of all I did a manual configuration to see if I could get it to work. So lets execute the following commands to clear the ip bindings from our network devices.
ifconfig wlan0 0.0.0.0 ifconfig eth0 0.0.0.0
Now lets create a bridge and add our network devices to it, using the brctl utility.
brctl addbr br0 brctl addif br0 eth0 brctl addif br0 wlan0
Finally bring the bridge up
ifconfig br0 192.168.0.50 up
Now try pinging machines on your wired and wireless networks – bingo!! Your box should now have the ip address of the bridge, and the bridge is clever enough to work out where to foward your requests too.
Ok now we’ve got that working lets add it to our /etc/network/interface file so it works on boot.
Your network devices no longer need entries in the interface file, except for your wireless device. This enables you to set your wireless configuration, but it won’t require an ip address. Your new configuration should look like this:
auto lo wlan0 br0
iface lo inet loopback
iface wlan0 inet manual
wireless-essid #########
wireless-mode managed
wireless channel 11
wpa-driver wext
wpa-conf /etc/wpa_supplicant.conf
iface br0 inet static
address 192.168.0.50
netmask 255.255.255.0
network 192.168.0.0
gateway 192.168.0.1
broadcast 192.168.0.255
bridge_ports wlan0 eth0
OK, if you reboot your machine all should be well.
For me the bridge did work, but not exactly as I wanted it too. When I connect my wired ethernet device to the switch I half expected it to feed the other devices connected to it, but it didn’t. I think I might have to set up a gateway for this. Also the wireless device keeps dropping out too.
Please let me know how you guys got on, and if you could recommend further config / setup details.




June 28th, 2010 at 4:26 pm
hi, thanks for the useful bingo info mate, there’s so many options these days it’s hard to know where to look for relevant info, thanks again.
May 5th, 2011 at 7:23 pm
THanks for the blog post, really helped out.
May 20th, 2011 at 5:52 pm
I do alot of web designing and developing as well.
January 5th, 2012 at 8:30 am
How do i convert a Joomla template to basic html/css template?