Solve the problem of failure to use the NIC (R8168 chip) on the motherboard of Gigabyte (GA) in Ubuntu.

Source: Internet
Author: User
Recently, a new server has been configured, because the gigabyte motherboard is used. After the Ubuntu system is installed, the network cannot be used at all. After investigation, we found that this is a driver problem. You must replace the NIC driver that comes with the system. Ubuntu11.04 (the same for other versions) comes with the r8169 driver. We must replace it with the official NIC Driver of RealTeck. The specific steps are as follows: Note: if the driver source code in the file cannot be downloaded, you can download r8168-8.024.00.tar.bz2 from the address below for free.

Recently, a new server has been configured, because the gigabyte motherboard is used. After the Ubuntu system is installed, the network cannot be used at all. After investigation, we found that this is a driver problem. You must replace the NIC driver that comes with the system.

Ubuntu 11.04 (the same for other versions) comes with the r8169 driver. We must replace it with the official NIC Driver of RealTeck. The procedure is as follows:

Note: If the driver source code cannot be downloaded, you can download r8168-8.024.00.tar.bz2 from the address.

Free onHttp://linux.linuxidc.com/

Both the user name and password areWww.linuxidc.com

The specific download directory is in/Pub/2011/08/14/solve the problem that the built-in NIC (chip R8168) of the gigabyte (GA) board cannot be used in Ubuntu system/

The Linux driver r8169 for the Realtek network chip in the EQ servers does not work correctly in CentOS 5.x, Ubuntu 9.04, OpenSUSE 11.1 and Debian Lenny. timeouts and state changes to link down may occur. the solution is to use the official Realtek r8168 driver. unfortunately this driver is not yet already ded in any distribution. for CentOS it can be installed from 3rd party repositories. for Debian and Ubuntu it must be compiled by the user.

This article describes how to setup the network driver.

Inhaltsverzeichnis
[Verbergen]
1 Using kmod-r8168 from elrepo.org on CentOS
2 Using r8168-kmp from the OpenSUSE 11.1 NIC drivers repo
3 Installation from source
3.1 Prerequisites
3.1.1 CentOS
3.1.2 Debian/Ubuntu
3.2 Getting the sources
3.3 Compiling the driver
3.4 Activating the new driver
3.4.1 CentOS
3.4.2 Debian Lenny/Ubuntu 9.04
 

Using kmod-r8168 from elrepo.org on CentOS
ELRepo is a RPM repository for Enterprise Linux packages. ELRepo supports Red Hat Enterprise Linux and its derivatives (CentOS, Scientific Linux and others ). it is the easiest way to get the r8168 driver for the standard upstream kernels.

NOTE: If you are using a special kernel like unzip ozzo, OpenVZ or something similar. You MUST compile the module yourself!

To install ELRepo for RHEL5, CentOS-5 or SL5:

Rpm-Uvh http://elrepo.org/elrepo-release-0.1-1.el5.elrepo.noarch.rpm
Import the public key:

Rpm -- import http://elrepo.org/RPM-GPG-KEY-elrepo.org
To install kmod-r8168 Realtek r8168 driver:

Yum -- enablerepo = elrepo install kmod-r8168
After reboot the new driver is used. It stays active even after kernel upgrades.

Due to the inadvertent application of an erroneous patch upstream, the updating of kmod packages is currently broken for CentOS 5.5 (el5.5). A workaround is explained at http://elrepo.org/tiki/Update

Using r8168-kmp from the OpenSUSE 11.1 NIC drivers repo
OpenSUSE offers prebuilt Kernel module packages (kmp). You just have to add the repository to zypper and install the matching package. In the example the-default kernel is assumed

Cd/etc/zypp/repos. d wget http://download.opensuse.org/repositories/drivers:/nic/openSUSE_11.1/drivers:nic.repo zypper install r8168-kmp-default
Before rebooting, the r8169 must be blacklisted.

Echo "blacklist r8169">/etc/modprobe. d/blacklist
After the reboot only the r8168 module shocould show up in 'lsmod'

Installation from source
Prerequisites
Please make sure you are running the latest kernel available with yum or apt-get.

CentOS
On CentOS the packages 'kernel-devel 'and 'kernel-headers' will install headers only for the newest kernel. The following packages need to be installed via the package manager:

Yum install gcc-c ++ kernel-devel kernel-headers
Debian/Ubuntu
On Ubuntu the name of the header package depends on the selected kernel. it can be for example 'linux-headers-generic 'or 'linux-headers-Server '. both will install headers only for the newest kernel. the following package will install everything required for compilation (as root ):

Aptitude install build-essential linux-headers-'uname-R'

Getting the sources
Cd/tmp wget http://download.hetzner.de/drivers/r8168-8.019.00.tar.bz2 tar xjf r8168-8.019.00.tar.bz2
Compiling the driver
Cd r8168-8.019.00 make all
Activating the new driver
CentOS
The file/etc/modprobe. conf needs to be edited. Change the line

Alias eth0 r8169
To

Alias eth0 r8168
To activate the new driver, we create a simple shell script that does the necessary steps.

Echo "rmmod r8169">/tmp/r8168 echo "depmod-a">/tmp/r8168 echo "modprobe r8168">/tmp/r8168 echo "service network restart"> >/tmp/r8168 echo "service ipaliases restart">/tmp/r8168
Execute that script:

Sh/tmp/r8168
After several seconds the server shocould be back online using the new network driver. Our working directory can now be removed:

Rm-rf/root/r8168
Debian Lenny/Ubuntu 9.04
After installing the driver, update the module dependencies.

Depmod-
First the r8169 network driver needs to be blacklisted in order to prevent the kernel from loading it. Note If additional parameters are installed in the server, the module must not be blacklisted.

Ubuntu: echo "blacklist r8169">/etc/modprobe. d/blacklist. conf Debian: echo "blacklist r8169">/etc/modprobe. d/blacklist
Then we force the kernel to include the driver in the initrd. This also ensures, that the new r8168 module is loaded before the r8169 module.

Echo "r8168">/etc/initramfs-tools/modules
And rebuild the initrd

Update-initramfs-v-u-k 'uname-R'
Now you can reboot to activate the driver.

After a kernel update the driver might need to be recompiled.]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.