Guide Installation r8168-Treiber/en

Aus EUserv Wiki

(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
Root (Diskussion | Beiträge)
(Die Seite wurde neu angelegt: „{{Languages|Guide_Installation r8168-Treiber}} Kategorie:Servers '''''Installation of the r8168 driver for Realtek network chips''''' __TOC__ <div style= "fon…“)
Zum nächsten Versionsunterschied →

Version vom 15:49, 2. Apr. 2014

Installation of the r8168 driver for Realtek network chips

Inhaltsverzeichnis

Installation of the r8168 driver for Realtek network chips

General

Based on the sometimes faulty functionality of the r8169 driver for Realtek network chips (also in the latest kernel versions) timeouts may occur as well as changes between the states link up/link down or system crashes.

This problem can be resolved by installing the official r8168 driver from Realtek instead of the driver included in the Linux kernel. Under CentOS the driver can be manually installed from the repositories. Under Debian and Ubuntu the driver has to be compiled from source and activated.

The following guide describes how to install the official Realtek driver.

Installation

Installation under Debian/Ubuntu

Installation from source

Prerequisites

Installation of the necessary packages for compiling with the following command:

aptitude install build-essential linux-headers-`uname -r` screen


Installing the driver

For installation, please follow these steps:

  • Downloading and extracting the sources:
cd /tmp
wget http://mirror.euserv.net/misc/r8168-8.038.00.tar.bz2
tar xjf r8168-8.038.00.tar.bz2
  • Check if kernel module can be compiled without errors with the command 'make modules':
cd r8168-8.038.00 && make modules
# optional: cd r8168-8.038.00 && make all
  • Compile the driver by running the script autorun.sh. The existing r8169 driver will be replaced:
screen
cd r8168-8.038.00
./autorun.sh

The network connectivity will be lost and the r8169 driver will be permanently deactivated. Instead, you can activate the new driver. By activating the new driver the network connection will not get lost and the driver will be just temporarily deactivated.

Activating the driver

Activate the driver, if you don't want to lose your current network connection. Please follow these steps to activate the driver:


  • Updating module dependencies:
depmod -a
  • Preventing automatical loading of the r8169 driver from the kernel:
echo "blacklist r8169" >> /etc/modprobe.d/blacklist.conf
  • Integrating the new driver in initrd:
echo "r8168" >> /etc/initramfs-tools/modules
  • Updating the initrd:
update-initramfs -v -t -u
  • Rebooting the server


The driver possibly has to be re-compiled after kernel updates in the future.


Installation under CentOS

Installation from repository

To install the r8168 driver from the repository, proceed as follows:

  • Integrate the necessary repository in the system by importing the public GPG key with the following command:
rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org

For RHEL-6 or CentOS-6 the GPG key will be imported with the following command:

rpm -Uhv http://elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm
  • Installation of the package with the new kernel module:
yum --enablerepo=elrepo install kmod-r8168


The changed driver will be used after a reboot and will also be used after an update of the kernel.


Installation from source

Prerequisites

Before the installation the following prerequisites have to be given:

  • Installation of the latest kernel via yum or apt-get
  • Booting of the kernel
  • Installation of the header packages 'kernel-devel', 'kernel-headers' of the kernel and the compiler for compiling the driver:
yum install gcc gcc-c++ kernel-devel kernel-headers

Installing the driver

To install the driver proceed as follows:

  • Downloading and extracting the sources:
cd /tmp
wget http://mirror.euserv.net/misc/r8168-8.038.00.tar.bz2
tar xjf r8168-8.038.00.tar.bz2
  • Check if the kernel module can be compiled without errors with the command 'make modules':
cd r8168-8.038.00 && make modules
# optional: cd r8168-8.038.00 && make all
  • Compile the driver by running the script autorun.sh. The existing r8169 driver will be replaced:
screen
cd r8168-8.038.00
./autorun.sh

The network connectivity will be lost and the r8169 driver will be permanently deactivated. Instead, you can activate the new driver. By activating the new driver the network connection will not be lost and the driver will be just temporarily deactivated.


Activating the driver

Activate the driver, if you don't want to lose your current network connection. Please follow these steps to activate the driver:

  • Open the file /etc/modprobe.conf and change the responsible driver for network interface eth0 by renaming the following entry:
old: alias eth0 r8169
new: alias eth0 r8168
  • Create a shell script with the necessary commands to activate the driver (since the network connection will be lost):
  
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
  • Run the created script:
sh /tmp/r8168
  • Delete the working directory after your server is reachable with the new network driver:
rm -rf /root/r8168

Installation under OpenSUSE

Installation from repository

To install the r8169 driver from the repository, please proceed as follows:

  • Add the necessary repository with zypper and install the corresponding module package:
cd /etc/zypp/repos.d
wget http://download.opensuse.org/repositories/drivers:/nic/openSUSE_Tumbleweed/drivers:nic.repo
zypper refresh
zypper install r8168-kmp-default
  • Prevent auto-loading of the r8169 driver before the reboot:
echo "blacklist r8169" >> /etc/modprobe.d/99-local.conf
  • Reboot the server.

After the reboot the driver should be permanently active.