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. |
<<TableOfContents: execution failed [Argument "maxdepth" must be an integer value, not "[1]"] (see also the log)>>
1. Hardware
Any of the following 10/100/1000M Gigabit Ethernet PCI Express NICs:
- RTL8111/B/C
- RTL8168B/C/CP
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.
Asus M3A78-EMH HDMI was reported to have a "weird behaviour" (quoting from the mailing list: 10Mbps link as shown by ethtool, 100Mbps link as shown by the link-indicator on the switch, ifconfig showed no TX-packets, some RX-packets, /billions/ of dropped packets - increasing by millions every second. The kernel log showed multiple 'Link down' entries.) http://www.asus.com/products.aspx?l1=24&l2=165&l3=0&l4=0&model=2289&modelmenu=1
According to the chip manufacturer this driver supports some of the chips which previously required
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.
On an MSI P35 Neo-F (model MS-7360) (note "rev 01" in the first line):
On an Asus P5GC-MX/GBL (note "rev 02" in the first line): On a Gigabyte GA-EG45M-DS2H -- again rev 02. Note this NIC is identified as an RTL8111C by the product documentation.
There are a few ways to get the driver. (1) Download and install the r8168 driver from Realtek's website at: 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 to install the driver (and all its dependencies) on your system. Pro: Against: (3) As yet another Pro:
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) If you are compiling the driver manually, you can compile the driver for kernel version other than the running one by using the procedure described below under Updating the Kernel. This step is (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).
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. r8168 Driver Disk Files for CentOS 5.2 See readme.txt.
The kernel's r8169 driver identifies the same PCI ID as its working hardware. A test with a Fedora 8 Test 1 Live CD showed that that kernel 2.6.23 attempts to load the r8169 driver. However it does not work. The CentOS 5.0 installer does not attempt to load the r8169. 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. 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.
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.
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. 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. Go to the src directory of the r8168 source. Edit Makefile. 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. If you have two copies present, use modinfo to identify the older driver and delete or rename it before rebooting. Update your bootloader configuration (usually /boot/grub/grub.conf) and reboot. upgrade kernel (and the corrresponding source) 1.1. Motherboards known to not work with the stock driver:
1.2. Realtek PCI-Express NIC Described here:
2. Problem
3. Output of `lspci -v` for a functional card
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
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
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
6. List of packages needed to install r1000/r8168/r8101
mandatory if you are upgrading the kernel via a remote connection and you are not using dkms. 7. Driver Disks
8. Notes
8.1. Update January 2009
9. Updating the Kernel
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. KVER := $(shell uname -r)
to your newly installed kernel version. For example: KVER := 2.6.22.9-MyCustomKernel
make all;
find /lib/modules/2.6.22.9-MyCustomKernel -name r8168.ko
depmod -a 2.6.22.9-MyCustomKernel