Junior working with WPA

Monday 25 June 2007

Junior is now working with WPA-based wireless. Hoping it might be useful to somebody else, this here retraces the steps I had to take to make it work.

There are basically two ways you can control the VT6655-based card provided with Norhtec Microclient Jr: through a native Linux driver, or through an encapsulation of Windows drivers achieved by a piece of software called ndiswrapper.

Browsing the VIA web site for drivers only provided a native driver for other versions of the kernel (mostly Fedora). Since the kernel API has changed in between, there is no way to make these work on a Debian Etch kernel (2.6.18-4-486). Going beyond that means pressuring VIA into either releasing the driver sources or releasing a binary version for this very kernel, an effort which would have to be repeated every time the kernel is upgraded to a non-compatible version (i.e. every new release). Forget it.

The other way proved to be the right one.

Through trial and failure, I found out that the default ndiswrapper version available on Debian corresponds to version 1.28, which is kind of late considering the latest version is 1.47. Many bugs corrections have happened in between and some of them are actually related to the VT6655 chip, so you definitely want to install it from the sources. As a side note, the Debian version is anyway only released through sources, you have to follow a non-obvious procedure to install it. A search on your favorite Search Engine for “debian install ndiswrapper” should yield results.

To install from sources: get the tar file from sourceforge. Untar it, cd into the directory you just decompressed and type make to build it. Change user to root and make install should install it all.

Now you have a kernel module that can encapsulate Windows drivers, but you still need to get the drivers. I cannot unfortunately host binary files on this site but you should be able to find them on Norhtec’s web site:

(URL soon published here)

Get the file, unzip it somewhere and cd into the directory. Now ask ndiswrapper to wrap it up with:

ndiswrapper -i VNWL.inf

Once the driver is available, type ndiswrapper -l to check it is actually there:

# ndiswrapper -l
vnwl : driver installed device (1106:3253) present

Now you can load the module into the kernel. Still as root:


# modprobe ndiswrapper

A quick look at kernel logs with dmesg should tell you about the driver being correctly loaded:


ndiswrapper version 1.47 loaded (smp=no)
ndiswrapper: driver vnwl (VNT,01/18/2005,1.30.00.0164) loaded
ndiswrapper: using IRQ 5wlan0: ethernet device xx:xx:xx:xx:xx:xx using NDIS driver:vnwl,
version: 0x1001e, NDIS version: 0x500, vendor:'VIA Networking Solomon Wireless LAN Adapter',
1106:3253.5.confwlan0: encryption modes supported: WEP; TKIPwith WPA, WPA2, WPA2PSK;
AES/CCMP with WPA, WPA2, WPA2PSK

Now you have a working wireless device in your box. You need to declare a new section in the /etc/network/interfaces file. First something like:


auto wlan0
iface wlan0 inet dhcp

Comment out the first line (auto wlan0) if you do not want the wireless interface to be brought up when you boot.

Now you can bring it up and scan wireless networks with:


# ifconfig wlan0 up
# iwlist wlan0 scanning
[...]

At that point you should be able to connect to your wireless network if it is unencrypted. Do not forget to put the correct settings on your access point for MAC address filtering if you use some, and temporarily deactivate encryption.

Now you want WPA, which is provided on Linux through wpa_supplicant. I juggled with a number of versions and compiling the beast from the sources is definitely not the easiest thing I have tried. Good news: the default Etch version works just fine (0.5.5-2). Install it:


# apt-get install wpasupplicant

An excellent point for the Debian package maintainer: wpa_supplicant has been integrated with the network scripts so that it can be controlled from the /etc/network/interfaces file. This is what my file looks like:


iface wlan0 inet dhcp
wpa-ssid MyAccessPoint
wpa-driver wext
wpa-psk 01234567890abcdef...
wpa-key-mgmt WPA-PSK
wpa-group TKIP

Several points:
- Replace MyAccessPoint by your access point’s name
- IMPORTANT: specify wext for the driver to be used, not ndiswrapper.
- Replace the key by yours
- I used the most basic WPA settings here. Compare to the settings on your access point.
- You can also use anonymous access points, but I am not sure how they would be declared in this file.
- These settings are for a DHCP server. For static addresses, see the documentation.

All these options and more are described here:
README.modes

That should be all. If your interface is still up, bring it down (ifconfig wlan0 down) and up again:


ifup wlan0

You should see some messages about the DHCP request and finally a success message showing the address you got.

I cannot thank enough the Norhtec guys for their incredible support in my search of the working driver. Junior has just gone one step beyond in terms of capabilities!


Hunting for a VIA VT6655 driver

Sunday 24 June 2007

I would like to get Junior to work with wireless, and unfortunately all I can do with the ndiswrapper driver is no crypto or WEP-only. This does not fit the bill: I need to connect to WPA-protected networks with this box.

There are two ways out of this: find a Windows driver that supports WPA correctly with ndiswrapper and wpa_supplicant, or push the guys at VIA to re-compile a driver for the kernel I use (Debian Etch). I asked on the dedicated VIA forums and got no reply so far. Check out the Linux Arena on the following page:

http://forums.viaarena.com/

There is no emergency since the box is currently wired to the network, but enhancing it to support wireless would boost even more its capabilities. I have a project to link to several of my neighbors over Wi-Fi in our own private network and junior would be perfect to take care of the link.

On a side note, I have hooked in a 40Gb USB drive to Junior and they match perfectly. Only USB 1.1 is supported, which makes data exchange a little slow but largely sufficient to serve files over a network. Now I can leave Junior awake at night to download 700-Mb blocks over the Net! With a little bit of scripting it should even be able to start downloads on its own.


WEP Ok

Tuesday 19 June 2007

Junior now has some wireless working… Not exactly what I wanted but at least WEP is working Ok. Here is the path I followed:

I have been dissecting the Internet to find all possible links to a possible driver for Via VT6655, until I stumbled upon this page:

http://www.minipci.biz/support.html

From there I downloaded a large binary file containing lots of drivers, including some for Linux. Tried them all, nothing works but I finally got a version of the Windows drivers I had never encountered before. They load fine with ndiswrapper and judging from the output of dmesg, present a working interface to the kernel.

Unfortunately, it seems I cannot upload binary stuff to this blog so you will have to download them from the above site and get them from the directory “windows 98ME2000XP” in the ZIP archive. They also publish a tiny URL for this ZIP file: http://tinyurl.com/blop7.

For future reference, the files I got had these MD5 signatures:


891b23e6b475aebb26b8a07fef9d73eb VNWL5A.sys
17a711d4271db402dcfa59e8c4084ddb VNWL5B.sys
3918dc675b662e1c0434d53a8a450b86 VNWL.inf

The ndiswrapper version distributed with Debian Etch apparently has problems with this driver, so I un-installed the official version and compiled my own, which I got from ndiswrapper.sourceforge.net.
Once installed, change directory to where you downloaded the above files and get the driver in with:


ndiswrapper -i VNWL.inf

Then load the ndiswrapper module into the kernel:


modprobe ndiswrapper

If everything goes fine, you should see something like this with dmesg:


wlan0: ethernet device 00:xx:xx:xx:xx:xx using NDIS driver:vnwl,
version: 0x1001e, NDIS version: 0x500,
vendor:'VIA Networking Solomon Wireless LAN Adapter ',
1106:3253.5.conf
wlan0: encryption modes supported: WEP; TKIP with WPA,WPA2, WPA2PSK;
AES/CCMP with WPA, WPA2, WPA2PSK
usbcore: registered new driver ndiswrapper

Now configure your interface using the /etc/network/interfaces file:


iface wlan0 inet dhcp
wireless-essid MyAccessPoint
wireless-key 1234567890ABCDEF...

Activate your access point with the same ESSID and WEP key, and switch on the interface with: ifup wlan0. You should now be connected.

For WPA, Debian only needs a version of wpa_supplicant to be installed. With Etch, no need to worry about various configuration files for WPA, all you have to do is configure again /etc/network/interfaces with your WPA parameters, like this:


wpa-ssid MyAccessPoint
wpa-driver ndiswrapper
wpa-psk 1234567890ABCDEF...
wpa-key-mgmt WPA-PSK
wpa-group TKIP

All WPA-related options are documented in Debian. You can find a description e.g. here: README.modes

Unfortunately this stops here. wpa_supplicant reports being unable to associate to the driver but no further reason is given so your guess is as good as theirs.

Many possibilities there: I have seen Via distributes a patched version of wpa_supplicant with the latest version of their drivers, but was unable to compile it. It might simply be a bug or insufficient code in wpa_supplicant, I certainly hope it is not a bug in the Windows driver.

So WEP is now working, which proves if needed that the provided hardware is indeed functional. If you are not worried about your network security, I guess this should be enough to get the ball rolling. If you are living like me in an intensive wireless area, you do not want to use WEP at all. WEP is horribly broken, avoid it whenever possible.

Tough nut to crack, but I will get to the end of it!