Realtek RTL8111B / RTL8168B NIC

All CentOS versions released after June 2008 include proper drivers for these chipsets so all the below information is obsolete. If run a recent CentOS version and you encounter issues with a Realtek wired network card, please consider installing the driver provided by Realtek and distributed as kmod by the ElRepo 3rd party repository. See https://wiki.centos.org/AdditionalResources/Repositories for details.


Starting with Centos 5.2, the stock kernel offers support for this chipset via the r8169 driver. However the driver currently works only for revision 01 of the network cards - and even those can still have problems (see below under Problem); the newer cards using revision 02 are identified by the stock kernel driver and can be configured, but they do not work. For problematic cases one of the methods described in Solutions below must be used.

1. Hardware

Any of the following 10/100/1000M Gigabit Ethernet PCI Express NICs:

This hardware is widely used by many motherboard manufacturers. A search of a single on-line vendor revealed over 40 different motherboards using some version of the RTL8111.

1.1. Motherboards known to not work with the stock driver:

1.2. Realtek PCI-Express NIC Described here:

Realtek RTL8111b Datasheet

According to the chip manufacturer this driver supports some of the chips which previously required the r1000 driver ( which as of version r1000_v1.06 is only maintained for kernel 2.4 and most important does not always work correctly with the new chipsets). Therefore on the above mentioned hardware if (and only if) the stock kernel driver does not work, please always try to use the newer r8168 driver instead of r1000.

2. Problem

Correct driver is not included with the standard CentOS 4.5, 5.0 and 5.1 distributions. The driver in CentOS 5.2 works for some but not for all of the cards. It has also been reported that under some circumstances, even the cards which seem to function with the driver included in 5.2 (see "rev 01" described below) sometimes still exhibit problems (big latencies, lock-ups). For example, see http://bugs.centos.org/view.php?id=3218.

3. Output of `lspci -v` for a functional card

On an MSI P35 Neo-F (model MS-7360) (note "rev 01" in the first line):

04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
 RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)
        Subsystem: Micro-Star International Co., Ltd. Unknown device 360c
        Flags: bus master, fast devsel, latency 0, IRQ 17
        I/O ports at e800 [size=256]
        Memory at febff000 (64-bit, non-prefetchable) [size=4K]
        Expansion ROM at febc0000 [disabled] [size=128K]
        Capabilities: [40] Power Management version 2
        Capabilities: [48] Vital Product Data
        Capabilities: [50] Message Signalled Interrupts: Mask- 64bit+ Queue=0/1 Enable-
        Capabilities: [60] Express Endpoint IRQ 0
        Capabilities: [84] Vendor Specific Information

4. Output of `lspci -v` for a non-functional card

On an Asus P5GC-MX/GBL (note "rev 02" in the first line):

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B
PCI Express Gigabit Ethernet controller (rev 02)
        Subsystem: ASUSTeK Computer Inc. Unknown device 82c6
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 0, Cache Line Size: 32 bytes
        Interrupt: pin A routed to IRQ 177
        Region 0: I/O ports at d800 [size=256]
        Region 2: Memory at cffff000 (64-bit, non-prefetchable) [size=4K]
        Region 4: Memory at efff0000 (64-bit, prefetchable) [size=64K]
        Expansion ROM at cffc0000 [disabled] [size=128K]
        Capabilities: [40] Power Management version 3
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [50] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
                Address: 0000000000000000 Data: 0000
        Capabilities: [70] Express Endpoint IRQ 1
                Device: Supported: MaxPayload 256 bytes, PhantFunc 0, ExtTag-
                Device: Latency L0s <512ns, L1 <8us
                Device: AtnBtn- AtnInd- PwrInd-
                Device: Errors: Correctable- Non-Fatal- Fatal- Unsupported-
                Device: RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
                Device: MaxPayload 128 bytes, MaxReadReq 512 bytes
                Link: Supported Speed 2.5Gb/s, Width x1, ASPM L0s L1, Port 0
                Link: Latency L0s <512ns, L1 <64us
                Link: ASPM Disabled RCB 64 bytes CommClk+ ExtSynch-
                Link: Speed 2.5Gb/s, Width x1
        Capabilities: [b0] MSI-X: Enable- Mask- TabSize=2
                Vector table: BAR=4 offset=00000000
                PBA: BAR=4 offset=00000800
        Capabilities: [d0] Vital Product Data

On a Gigabyte GA-EG45M-DS2H -- again rev 02. Note this NIC is identified as an RTL8111C by the product documentation.

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B
PCI Express Gigabit Ethernet controller (rev 02)
        Subsystem: Giga-byte Technology Unknown device e000
        Flags: bus master, fast devsel, latency 0, IRQ 50
        I/O ports at b000 [size=256]
        Memory at e1510000 (64-bit, prefetchable) [size=4K]
        Memory at e1500000 (64-bit, prefetchable) [size=64K]
        [virtual] Expansion ROM at e1520000 [disabled] [size=64K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] Message Signalled Interrupts: 64bit+ Queue=0/1 Enable+
        Capabilities: [70] Express Endpoint IRQ 1
        Capabilities: [b0] MSI-X: Enable- Mask- TabSize=2
        Capabilities: [d0] Vital Product Data
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [140] Virtual Channel
        Capabilities: [160] Device Serial Number xx-xx-xx-xx-xx-xx-xx-xx

5. Solutions

There are a few ways to get the driver.

(1) Download and install the r8168 driver from Realtek's website at:

Realtek Driver Download

Direct download links were previously provided here. Realtek has changed the links on the above page to a Javascript tool that makes it difficult to extract the links. Follow the link above and look for LINUX driver for kernel 2.6.x and 2.4.x to download the current driver.

Pro:

Against:

(2) As an alternative method, a dkms-enabled driver package can be downloaded from RPMForge. Please follow the instructions available at http://wiki.centos.org/Repositories/RPMForge to install and activate this repository. After that you can use

to install the driver (and all its dependencies) on your system.

Pro:

Against:

(3) As yet another alternative method, the driver may be downloaded as a kABI tracking kmod RPM package from the ELRepo repository (thanks to Alan for contributing these packages). Select the kmod package that matches your kernel and install it with:

Pro:

6. List of packages needed to install r1000/r8168/r8101

this section does not apply to the kmod packaged driver from solution (3) above.

Here is the full list of packages which must be installed in order to compile the driver from source.

Centos 5

Centos 4

Centos 3

Repository

Observation

binutils

binutils

binutils

standard

(1)

gcc

gcc

gcc

standard

(1)

glibc-devel

glibc-devel

glibc-devel

standard

(1)

glibc-headers

glibc-headers

glibc-headers

standard

(1)

kernel-headers

glibc-kernheaders

glibc-kernheaders

standard

(1)

kernel-devel

kernel-devel

kernel-source

standard

(1) (2) (3)

make

make

make

standard

(1)

dkms

dkms

dkms

RPMForge

(4)

(1) standard = Base + Updates repositories.

(2)

(3) If you are using xen, please install and use kernel-xen-devel instead of kernel-devel.

(4) Only needed if installing dkms-r8168. You can check the state of the module any time using the command dkms status. The most interesting states are: added (the module has been successfully registered with the dkms system, but it has not been compiled) and installed (the module has also been successfully compiled).

7. Driver Disks

Driver disks for the following releases have been created and can be used while installing a new system :

These driver disks are for i686 and x86_64 arches only.

8. Notes

An exchange with Francois Romieu, one of the kernel developers for the r8169 driver, confirmed that the functionality of Realtek's r8168 and r8169 drivers will be incorporated into the kernel's r8169 driver. The kernel changelog shows a merge with Realtek's drivers in July 2007.

Kernel r8169 Changelog

This was confirmed November 2007 using the first release of Fedora 8 (kernel 2.6.23.1-42.fc8) on a Gigabyte GA-P35-DS4 and an MSI P35 Neo-F E7360, both with an RTL8111B on-board. The kernel's r8169 driver correctly identified and configured the on-board NIC.

8.1. Update January 2009

To test a more recent kernel than that provided by the upstream vendor, a rev 02 motherboard (a Gigabyte GA-EG45M-DS2H) was tested with Fedora 10 (kernel 2.6.27.5-117.fc10). As previously seen, the kernel identified the NIC and loaded the r8169 driver but still did not operate the NIC correctly. The same hardware was also tested with GParted Live 0.4.1-2, which is based on Debian Lenny (kernel 2.6.26-12). Interestingly, this software did correctly initialize and operate the RTL8111C rev. 02 NIC.

9. Updating the Kernel

this section does not apply to the kmod packaged driver from solution (3) above or if you have used one of the driver disks from section 7 above because those drivers work seamlessly across kernel updates via the weak-updates mechanism.

When a NIC driver isn't included in the kernel, remotely (that is over a telnet or ssh session) updating the kernel can be a problem. A few extra steps can make this possible.

  1. Install the new kernel. Either from RPM or compiling a custom kernel. If installing from RPM, the associated kernel-devel package will also need to be installed.

  2. Do not reboot. The NIC driver hasn't been added to the new kernel yet. Rebooting now means an inactive NIC and a visit to the console.

  3. Go to the src directory of the r8168 source. Edit Makefile.

  4. Change the line
    KVER           := $(shell uname -r)
    to your newly installed kernel version. For example:
    KVER           := 2.6.22.9-MyCustomKernel
  5. Go back to the top directory of the r8168 source and recompile and install the driver:
    make all;

    This will overwrite any existing r8168.ko driver. If you want to keep the older driver, rename the existing file before compiling the new driver.

  6. Confirm that the driver was copied to the right place. For example:
    find /lib/modules/2.6.22.9-MyCustomKernel -name r8168.ko

    If you have two copies present, use modinfo to identify the older driver and delete or rename it before rebooting.

  7. Run:
    depmod -a 2.6.22.9-MyCustomKernel
  8. Update your bootloader configuration (usually /boot/grub/grub.conf) and reboot.

Note: if you install the above mentioned dkms-r8168 package and leave the dkms-autoinstaller service enabled, steps 3-7 will be performed automatically after you boot with a new kernel, provided you have updated the corresponding kernel-headers (kernel-devel/kernel-source) package. So basically all you would have to do is

  1. install dkms-r8168
  2. upgrade kernel (and the corrresponding source)

  3. make sure the dkms-autoinstaller service is active
  4. reboot

AdditionalResources/HardwareList/RealTekRTL8111b (last edited 2016-05-22 23:58:58 by ManuelWolfshant)