realtek rtl8111/8168b fix in centos 5.2 +

I purchased recently a Dell Vostro 220 to use it as test server, in addition to my current 3 ones. These boxes are great and inexpensive, perfect for development. Unfortunately, CentOS 5.2 loads the Realtek r8169 driver module into its kernel. No Internet, no yum updates… Well the fix is very easy.

Try these steps:

1. Verify the Realtek card type:
# lspci | grep Ethernet

I have the Realtek RTL8111/8168B PCI Express Gigabit controller.

2. Determine what kernel you run:
# uname -rmi

3. Download the appropriate RPM (compiled by Alan Bartlett).
Although there is nothing wrong with his files, I noticed that Alan “modified” the original Realtek archive and I did not wanted to go this route. I’ve made my own RPM using the kmodtool available at KernelDrivers.org site and original Realtek archive. It is extremely easy to make it, plus the RPM will be signed with your own signature key.

Realtek says that the r8169 module should be unloaded before the r8168 one is loaded into kernel. Well, I did not need to do this, it worked fine. If for any reason you encounter problems, follow these steps:

1. Check if the local.modules file is present. If not, create it:
# touch /etc/sysconfig/modules/local.modules

2. Own it by root and make it executable:
# chown root:root /etc/sysconfig/modules/local.modules
# chmod 0755 /etc/sysconfig/modules/local.modules

3. Insert this shell content, into local.modules file:

#!/bin/sh

/sbin/modinfo -F filename r8168
if [ $? -eq 0 ]; then
	/sbin/modprobe -r r8169
	/sbin/modprobe r8168
fi

Related Entries

10 Responses to “realtek rtl8111/8168b fix in centos 5.2”

  1. hi there

    what is the best way to install the RPM onto the system, given that network isnt working? I tried mounting USB flash drive, and that didnt work.

    any thoughts?

    thanks

    -avi

  2. An USB flash drive will do the trick, just copy the file to a local directory. You will also need to have installed the RPM package, latest is 4.4.2-48.el5 version.

    $ cp /media/disk/kmod-r8168-8.010.00_NAPI-1.el5.x86_64.rpm /home/floren/tmp
    $ su -
    # rpm -ivh /home/floren/tmp/kmod-r8168-8.010.00_NAPI-1.el5.x86_64.rpm
  3. Hi. I have the same problem with the same PC and i try your solutions and didn’t work, any idea??

  4. First, make sure you install the proper RPM version.
    Check what kernel you have installed:

    yum list kernel*

    After you install the RPM, run:

    /sbin/modprobe -r r8169
    /sbin/modprobe r8168

    Then, reboot the server. Let me know the results.

  5. Hey Floren;

    Thanks for that. One last issue hopefully you have some thoughts on: how do I mount an NTFS USB drive on CentOS?

    I tried doing

    “mount /dev/sdb/ /mnt/sda1 -t NTFS”

    but it complains:

    mount: unknown filesystem type ‘ntfs’

  6. You will need a custom kernel, for NTFS. It is available into centosplus repo, so you do not have to compile anything.

    Once you have the right kernel updated, follow the NTFS mounting instructions. Please note that the NTFS module is not enabled in the centoplus kernel starting with CentOS 5.3. This is because NTFS in 5.3 is broken. See the bug info, for more details.

  7. Hey Floren;

    Thanks again for the help.

    I guess I back to where I started. Without a network connection, the only way to load new software is via USB drive, or CD/DVD. Without NTFS support, USB Flash is out for the moment.

    Any idea what I need to do to mount either a CD-R or DVD+R created on a windows box so it will mount properly on CentOS 5?

    -avi

  8. Just use an USB thumb, it costs $10.00. :)
    CentOS will automatically detect the flash drive, because it is formatted in FAT32. You can also use the fat32format utility to quickly/properly format an NTFS drive to FAT32. I fixed some USB thumbs with it, works very well.

  9. I reformatted USB drive to FAT32, and reinstalled, and thought “check with fdisk -l to ensure device mount”, and lo and behold I WAS USING THE WRONG device… so FAT32 mounted fine, and I RPM’ed the file, rebooted, and … still no ethernet. bummer.

    I did an lspci and the RTL8111/8168B controller is loaded and running, so I guess something else is going on.

    oh well. Im not sure what step I take next (aside from getting another machine, which I would like to avoid), but I do very much appreciate all your help. I learned alot.

    thanks again

    -avi

  10. Run this:

    # /sbin/modinfo -F filename r8168
    /lib/modules/.../kernel/drivers/net/r8168.ko

    If you do not get the above response, your module is not installed properly. If you get the response, run this:

    # /sbin/modprobe -r r8169
    # /sbin/modprobe r8168

    Then, reboot the server.

Leave a Reply