Hardware Secrets Forums

Go Back   Hardware Secrets Forums > Hardware > Networking


Reply
 
Thread Tools Display Modes
Old 08-05-2008, 11:57 AM   #1
Gabriel Torres
Administrator
 
Gabriel Torres's Avatar
 
Join Date: Oct 2004
USA
Posts: 2,548
Gabriel Torres is on a distinguished road

Default Installing Realtek RTL8111 (R8168) on Debian Linux

Hi guys,

Since I've been struggling on the last 2 days to install Realtek RTL8111 NIC on Debian and finally could put it to work, I decided to post here exactly what I had to do.

I faced two main problems. First, I had to download and burn the DVD version of Debian, because the CD version doesn't have commands needed to compile (make and gcc, for example) and since the network card wasn't recognized, I couldn't download them using apt-get install.

The second main problem is that even though Realtek provides the Linux drivers for RTL8111 (called R8168), the make command complains that it couldn't find the directories ("make[1]:**no rule to make target 'modules'" error message), so you will have to edit Makefile file. The problem is that it was hard to find what exactly what I should have done, since Realtek's FAQ only says that I needed to install Linux Kernel source.

Here is a step-by-step guide of what I had to do. Remember, I had just finished installing Debian 4.0 (DVD version). Keep the installation DVD in the DVD-ROM:

1. Install make and gcc

apt-get install make
apt-get install gcc

2. Install kernel souces

apt-get install linux-kbuild-2.6.18
apt-get install linux-headers-2.6.18-6
apt-get install linux-headers-2.6.18-6-686

3. Download and copy Realtek drivers. Since the system wasn't recognizing the network card I had to burn a CD with the driver.

ftp://202.65.194.211/cn/nic/r8168-8.008.00.tar.bz2

After copying this file to a directory (e.g. /root), unpack it:

bunzip2 r8168-8.008.00.tar.bz2
tar -xvf r8168-8.008.00.tar

4. Edit the Makefile file present under "src" directory:

vi r8168-8.008.00/src/Makefile

And then change the following line:

Original:
KDIR := /lib/modules/$(KVER)/build

Modified:
KDIR := /usr/src/linux-headers-2.6.18-6-686/

5. Then you can follow what is described in the readme:

rmmod r8169
make clean modules
make install
depmod -a
insmod ./src/r8168.ko
ifconfig -a

Notice how your NIC will be called (probably eth0 or eth1).

6. Then all you need to do is to edit the interfaces file to add your NIC configuration:

vi /etc/network/interfaces

add:

# The Ethernet card
auto eth0
iface eth0 inet dhcp

Our system was connected to a broadband router, so we were using its DHCP ability to get an IP address.

Then:
ifdown eth0
ifup eth0

7. Bingo! Your NIC will be working fine. Reboot with

shutdown -r now

And see your internet working.

You can test it with simple commands like ifconfig (to see the IP address your DHCP server assigned to your system), ping www.google.com and nslookup www.google.com.

Enjoy!

Cheers,
Gabriel Torres
Gabriel Torres is offline   Reply With Quote
new Sponsored Links

This advertisement is only shown to unregistered users. Register today and stop seeing this ad.

Old 12-28-2008, 05:33 AM   #2
Arrikhan
Junior Member
 
Join Date: Dec 2008
Posts: 1
Arrikhan is on a distinguished road

Default

I appreciate you capturing this detail in installing this driver. It's the first concise walkthrough for this problem I have seen (I've been at it half the day!)

I followed the instructions mostly to the letter for my version of debian and came across an error on the last command..

insmod ./src/r8168.ko

I get a repsonse of ..

insmod: error inserting './src/r8168.ko': -1 Invalid module format

I did note that I've installed the kernel sources available to me being the same as you have listed, although my version as per uname is 2.6.16-2-686 which is different. (i used apt-get using an old network card to assist).

modinfo against the above file outputs the following..

filename: ./src/r8168.ko
author: Realtek and the Linux r8168 crew <netdev@vger.kernel.org>
description: RealTek RTL-8168 Gigabit Ethernet driver
license: GPL
version: 8.009.00-NAPI
vermagic: 2.6.18-6-686 SMP mod_unload 686 REGPARM gcc-4.1
depends:
alias: pci:v000010ECd00008168sv*sd*bc*sc*i*
srcversion: DEFCC4DF8145E8BF674B676
parm: debug:Debug verbosity level (0=none, ..., 16=all) (int)
parm: use_dac:Enable PCI DAC. Unsafe on 32 bit PCI slot. (int)
parm: rx_copybreak:Copy breakpoint for copy-only-tiny-frames (int)
parm: autoneg:force phy operation. Deprecated by ethtool (8). (array of int)
parm: duplex:force phy operation. Deprecated by ethtool (8). (array of int)
parm: speed:force phy operation. Deprecated by ethtool (8). (array of int)


I am curious if the vermagic number above which differs to my linux kernel version is the cause of this?

I've read in some other posts that having the wrong auth causes this also but I have done all this as root.

Since you've gone through the effort, I thought you might know/understand why?

Hope you can help ..

Regards,


Arrikhan
Arrikhan is offline   Reply With Quote
Old 12-29-2008, 09:48 AM   #3
Gabriel Torres
Administrator
 
Gabriel Torres's Avatar
 
Join Date: Oct 2004
USA
Posts: 2,548
Gabriel Torres is on a distinguished road

Default

I really don't know, sorry, because with me this command worked just fine.

Cheers,
Gabriel.
Gabriel Torres is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Forum Jump


All times are GMT -8. The time now is 05:45 AM.


© 2004-9, Hardware Secrets, LLC. All rights reserved.