Saturday 2 February 2008

Realtek 8168B network cards and Ubuntu 7.10

Rather than buying a server off the shelf for the Community Centre I've decided to build a server from scratch.

The motherboard I chose for the server was an MSI P35 Neo2-FR motherboard. The board is based on the Intel P35 chipset, includes two 16x PCI Express slots (although one of them runs at 4x speed) and it's ready for the latest quad core and next generation of Core2 CPUs.

I decided on this board because of the good reviews on Tom's Hardware Guide, plus I have one of these boards in my own PC.

What I didn't realise though was the issues encountered with the on board network and Ubuntu 7.10.

It seems that Ubuntu 7.10 picks the wrong driver (r8169) which works put doesn't perform very well.

So after much searching I found a rather useful post on the Ubuntu Forums here.

Basically what you have to do is download the driver for the card from Realtek's web site here (select the Linux driver for kernel 2.6.x and 2.4.x (support x86 and x64).

I was a bit worried about the driver being some closed source binary blob but I'll give credit to Realtek, the driver is released under the GPL and includes source!

So when you've downloaded the driver, untar it (the filename may change depending on which driver version you download)...

# tar xfvj r8168-8.005.00.tar.bz2

Change to the directory where the driver is...

# cd r8168-8.005.00

Run the following commands to make the driver and test it works...

# make clean modules
# make install
# depmod -a
# insmod ./src/r8168.ko

Check if the driver is loaded...

# lsmod | grep r8168

I get the following output on my machine

r8168 37520 0

# ifconfig -a

This should list the network card (although when I installed the driver I was already running the r8169 driver which was the incorrect driver).

Now you need to install the driver. Rename the r8169 driver so it's not loaded at boot up.

# mv /lib/modules/`uname -r`/kernel/drivers/net/r8169.ko /lib/modules/`uname -r`/kernel/drivers/net/r8169.ko.old

(The above command should be on one line!)

# depmod -a

Now backup the current ram disk image and make a new one.

# mv /boot/initrd.img-`uname -r` /boot/initrd.img-`uname -r`.old
# mkinitramfs -o /boot/initrd.img-`uname -r`

Now reboot the machine, all being well the new driver should load.

You can check this by opening a terminal and entering...

lsmod | grep r8168

It should hopefully display the r8168 module.

If anything goes wrong, just follow these steps to enable the old driver.

# mv /lib/modules/`uname -r`/kernel/drivers/net/r8169.ko.old /lib/modules/`uname -r`/kernel/drivers/net/r8169.ko

# mv /boot/initrd.img-`uname -r`.old /boot/initrd.img-`uname -r`

Hopefully this will help anyone else who's bought a new motherboard which has a Realtek 8168/8111 network card on board.

Rob

Monday 28 January 2008

The project is taking shape

Well after a break over Christmas the project is starting to take shape at the Exwick Community Centre.

We've been brainstorming on how best to install things and what we need. Now all we need to do is get a shopping list together put in the grant application. Hopefully by Friday the final grant application will be ready to post.