## page was renamed from HardwareList/RealTekRTL8111b #acl ManuelWolfshant,kirkbocek,BillScheel:read,write,revert,delete Default #pragma section-numbers 2 = 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. || <> == 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. === Motherboards known to not work with the stock driver: === * [[http://www.asus.com/products.aspx?l1=3&l2=149&l3=639&l4=0&model=2064&modelmenu=2|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||Asus Eee Box]] * [[http://www.asus.com/products.aspx?l1=3&l2=11&l3=498&l4=0&model=1993&modelmenu=2|Asus P5GC-MX/GBL]] * [[http://www.gigabyte.com.tw/Products/Motherboard/Products_Overview.aspx?ProductID=2693|Gigabyte GA-G31M-S2L]] * [[http://www.gigabyte.com.tw/Products/Motherboard/Products_Overview.aspx?ProductID=2831|Gigabyte GA-EP45-DQ6]] * [[http://global.msi.com.tw/index.php?func=proddesc&maincat_no=1&prod_no=1436|MSI K9A2GM-FD / FIH / FIH-S]] * [[http://www.gigabyte.com.tw/Products/Motherboard/Products_Overview.aspx?ProductID=2877|Gigabyte GA-EG45M-DS2H]] === Realtek PCI-Express NIC Described here: === [[http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=13&PFid=5&Level=5&Conn=4&DownTypeID=1&GetDown=false|Realtek RTL8111b Datasheet]] According to [[http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=13&PFid=5&Level=5&Conn=4&DownTypeID=3&GetDown=false#2|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'''. == 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. == 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 }}} == 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- SERR- > == List of packages needed to install r1000/r8168/r8101 == || {{attachment:ArtWork/WikiDesign/icon-admonition-info.png}} ||||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) * Under all circumstances, the kernel-headers / kernel-devel / kernel-source package must match the version of the kernel for which the driver is compiled (not necessarily the running kernel). * At boot time, dkms will detect if the existing driver module matches the running kernel and will compile a newer one if needed, provided that kernel-headers / kernel-devel / kernel-source matches the running kernel. * 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 [[http://wiki.centos.org/AdditionalResources/HardwareList/RealTekRTL8111b#head-bcef34f2cd9986a57262a822ad31761e70e2e9a6|Updating the Kernel]]. This step is '''mandatory''' if you are upgrading the kernel via a remote connection and you are not using dkms. (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 == Driver disks for the following releases have been created and can be used while installing a new system : * CentOS 4.5 (kernel 2.6.9-55.EL) * CentOS 5.0 (kernel 2.6.18-8.el5) * CentOS 5.1 (kernel 2.6.18-53.el5) * CentOS 5.2 (kernel 2.6.18-92.el5) These driver disks are for i686 and x86_64 arches only. * [[attachment:r8168-2.6.18-8.el5_2.6.9-55.EL4_i686_x86_64.img.zip|r8168 Driver Disk for CentOS 4.5 and 5.0]] * [[attachment:r8168-2.6.18-53.el5-i686-x86_64.img.zip|r8168 Driver Disk for CentOS 5.1 and newer]] * [[attachment:r8168-ddfiles-el5.2-i686-x86_64.zip|r8168 Driver Disk Files for CentOS 5.2]] See readme.txt. == Notes == . 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. [[http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=history;f=drivers/net/r8169.c;h=419c00cbe6e962bac5e1ea095848628415566e51;hb=HEAD|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. === 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. == Updating the Kernel == || {{attachment:ArtWork/WikiDesign/icon-admonition-info.png}} ||||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 [[http://wiki.centos.org/AdditionalResources/HardwareList/RealTekRTL8111b#head-352e1d6e797bda68ed8b82ccaa7b165372f7a084|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. 1. '''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. 1. Go to the {{{src}}} directory of the r8168 source. Edit {{{Makefile}}}. 1. Change the line {{{ KVER := $(shell uname -r)}}} to your newly installed kernel version. For example: {{{ KVER := 2.6.22.9-MyCustomKernel}}} 1. 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. 1. 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. 1. Run: {{{ depmod -a 2.6.22.9-MyCustomKernel}}} 1. 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 1. upgrade kernel ''(and the corrresponding source)'' 1. make sure the dkms-autoinstaller service is active 1. reboot