2009년 1월 22일 목요일

Debian Linux 깔기 - 네트워크 카드

Debian 리눅스를 설치하다가 네트워크 드라이버 때문에 고생했는데,
(기종: RealTek RTL8111 / 8168)
웹에서 찾은 해결책을 여기 퍼다 놓도록 한다.

--

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

댓글 없음:

댓글 쓰기