WG311v3 LINUX WIKI

From Jimbo7-wiki

This is my guide to installing the WG311v3 driver in Debian, Linux. I have used ndiswrapper and wpa_supplicant to achieve this. While this was written specifically for Debian and this network card, I'm sure there is probably information here useful for other cards and distributions.

NB: Everything in this article must be done as root. To login as root, type su at the command prompt.

Contents

[hide]

NdisWrapper

First get NdisWrapper using either apt and module-assistant:

# apt-get install module-assistant
# module-assistant auto-install ndiswrapper

or download and compile from source. (NB: Using the source version of ndiswrapper is preferable as it is the latest and generally most usable version)

This guide was written using the NDISWRAPPER version 1.47

see also: 'Install Debian' section of the official NdisWrapper Wiki

Windows Driver

I used the Win2000 version of the W311v3 driver contained in this tgz file. I used that version of the driver as all of the drivers that came on my installation CD didn't work.

Copy the Windows driver files into a temporary directory:

# cp WG311v3.INF WG311v3.sys WG311v3XP.sys /home/jimbo7/temp_dir

Installation

Wrap the Driver

Wrap the driver using ndiswrapper:

# ndiswrapper -i /home/jimbo7/temp_dir/WG311v3.INF

check that the driver has wrapped ok: (should return driver installed, device (XXX) present)

# ndiswrapper -l
wg311v3 : driver installed
        device (11AB:1FAA) present

Install the Driver

  • First check that the ndiswrapper and usbcore modules are available:
# modinfo ndiswrapper
filename:       /lib/modules/2.6.17.7.kangoo/misc/ndiswrapper.ko
license:        GPL
version:        1.22
...

# modinfo usbcore
filename:       /lib/modules/2.6.17.7.kangoo/kernel/drivers/usb/core/usbcore.ko
license:        GPL
alias:          usb:v*p*d*dc*dsc*dp*ic09isc*ip*
...


  • then do a test insertion, ensuring it returns the correct response:
# modprobe -n -v --first-time ndiswrapper
insmod /lib/modules/2.6.17.7.kangoo/misc/ndiswrapper.ko


  • Insert the wrapped module using modprobe (there should be no response):
# modprobe ndiswrapper


  • Check that the driver has installed properly by checking with dmesg:
# dmesg

...
ndiswrapper version 1.17 loaded (preempt=no,smp=no)
ndiswrapper: driver wg311v3 (NETGEAR,02/22/2005,3.1.1.7) loaded
ACPI: PCI Interrupt 0000:01:06.0[A] -> Link [APC3] -> GSI 18 (level, high) -> IRQ 201
PCI: Setting latency timer of device 0000:01:06.0 to 64
ndiswrapper: using irq 201
wlan0: vendor: ''
wlan0: ndiswrapper ethernet device 00:14:6c:71:bf:e1 using driver wg311v3, 11AB:1FAA:1385:6B00.5.conf
wlan0: encryption modes supported: WEP; TKIP with WPA, WPA2, WPA2PSK; AES/CCMP with WPA, WPA2, WPA2PSK


  • if dmesg returns something like this, then the module has failed to load:
# dmesg

...
ndiswrapper version 1.17 loaded (preempt=no,smp=no)
ndiswrapper (fixup_reloc:391): unknown fixup: 00000002
ndiswrapper (load_sys_files:213): couldn't prepare driver 'wg311v3'
ndiswrapper (load_wrap_driver:111): loadndiswrapper failed (65280); check system log for messages from 'loadndisdriver'
...
  • This happened to me a few times, and funnily enough just reloading the module several times seemed to fix it:
# modprobe -r ndiswrapper
# modprobe ndiswrapper


see also: Installation section of the official NdisWrapper Wiki

Testing Installation

iwconfig gives info on the wlan card:

# ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 00:14:6C:71:BF:E1
          inet6 addr: fe80::214:6cff:fe71:bfe1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11 errors:0 dropped:15 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:675 (675.0 b)  TX bytes:2555 (2.4 KiB)
          Interrupt:201 Memory:ee010000-ee020000


iwlist scan scans for access points in the area:

# iwlist wlan0 scan
wlan0     Scan completed :
          Cell 02 - Address: 00:14:BF:F1:80:BC
                    ESSID:"linksys"
                    Protocol:IEEE 802.11g
                    Mode:Managed
                    Frequency:2.462 GHz (Channel 11)
                    Quality:0/100  Signal level:-91 dBm  Noise level:-256 dBm
...

Set ndiswrapper to load on startup

Create an alias into the module configuration file using

# ndiswrapper -m

Then add the line ndiswrapper to the file /etc/modules

# echo ndiswrapper >> /etc/modules

WPA-PSK with wpa_supplicant

  • First get wpa_supplicant, either from source or using apt:
# apt-get install wpa-supplicant


  • create a config file /etc/wpa_supplicant.conf that contains the following (obviously changing the values of ssid and psk):
network={
  ssid="SSID_goes_here"
  psk="password_goes_here"
  priority=5
  key_mgmt=WPA-PSK
  proto=WPA
}

Please note there are different variants of WPA. If it is not possible to authenticate with the above settings, try looking in the wpa_supplicant.conf man page.


  • You should make /etc/wpa_supplicant.conf readable only to root:
# chmod 600 /etc/wpa_supplicant.conf


  • Start wpa_supplicant to connect to the wireless access point:
# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -Dwext
  • Once the connection is established, it is safe to close the root terminal window. I have set up a script that I run with sudo to connect to the network.

NOTE: A reader Christian suggested using the Ndiswrapper driver instead of WEXT. Personally I did not need to do this, but that is how he fixed some issues he was having. To use this driver replace the -Dwext switch with -Dndiswrapper in the wpa_supplicant command above.

WPA-PSK Passkey

As all WPA-PSK keys can (eventually) be broken using brute force attacks, it is important to use a completely random, non-sensical passkey. The time it takes to break a WPA key that is of the highest strength may take years but it is possible - so change your keys often. The WPA-PSK Key Generator is one of the best out there as it uses javascript to generate the key locally on your own PC, ie: the key is not sent over the internet.

Connect To The Network

Once connected with wpa_supplicant above, use either ifup wlan1 or dhclient wlan1 to get an IP address on the network