You are here: Home / Debian GNU/Linux / System / Setup / Fix the RTL8111/8168B network device on Debian

Fix the RTL8111/8168B network device on Debian

by Pierre-Yves Landuré last modified Mar 02, 2018 08:35

By default, Debian use the rt8169 module for the RTL8111/8168B. This module can be source of various bugs, among witch random reboots due to kernel panic caused by heavy network load. This howto setup the rt8168 module that is known to work well with this device.

This howto is tested on :

  • Debian 6.0 Squeeze

Installation

Install the required software :

command apt-get install dkms gcc bzip2 \
"linux-headers-$(command uname -r)" \
"linux-headers-$(command uname -r \
| command sed -e 's|2.6.[^-]*-[^-]*-|2.6-|')"

Define the source URL and the version number:

SOURCE_URL="http://howto.biapy.com/fr/debian-gnu-linux/systeme/configuration/reparer-la-carte-reseau-rtl8111-8168b-sur-debian/r8168-8.026.00.tar.bz2/at_download/file"
VERSION="8.026.00"

Download the sources :

command wget "${SOURCE_URL}" \
--quiet --output-document="/tmp/r8168-${VERSION}.tar.bz2"

Decompress the sources in /usr/src :

command tar --directory='/usr/src' -xjf "/tmp/r8168-${VERSION}.tar.bz2"

Delete the downloaded file :

command rm "/tmp/r8168-${VERSION}.tar.bz2"

Create the DKMS configuration file :

echo "PACKAGE_NAME=r8168
PACKAGE_VERSION=${VERSION}
MAKE[0]=\"'make'\"
BUILT_MODULE_NAME[0]=r8168
BUILT_MODULE_LOCATION[0]=\"src/\"
DEST_MODULE_LOCATION[0]=\"/kernel/updates/dkms\"
AUTOINSTALL=\"YES\"" > "/usr/src/r8168-${VERSION}/dkms.conf"

Add the module sources to DKMS modules :

command dkms add -m r8168 -v ${VERSION}
command dkms build -m r8168 -v ${VERSION}
command dkms install -m r8168 -v ${VERSION}

Reboot the system to force the use of the new module.

Thanks