miércoles, 3 de noviembre de 2010

HowTo: Installing Realtek 8111C GbE Drivers for CentOS

HowTo: Installing Realtek 8111C GbE Drivers for CentOS

If you are assembling an Elastix (or other) system based on the CentOS version of Linux, you may have trouble with the network port and getting it to work. To resolve this, you may need to compile and install suitable drivers.
While I was building a low energy Elastix 1.5.2 system based on Intel’s D945GCFL2D mother-board, I discovered that the Elastix installer (from CD) did not configure the correct drivers for the network port. This article describes how to remedy the situation and get network activity working.
The instructions here are for the Realtek 8111C built into the Intel D945GCFL2D mother-board to be used under an Elastix 1.5.2 installation.  They probably can be adapted for other similar set-ups.
First you need to download the latest drivers from the Realtek web site.  This mother-board uses the 10/100/1000 drivers for PCI Express family.  At the time of writing, there was a bug on the Realtek web site and I had to download the drivers form an alternative source.  So I have made the drivers available from here too:
  r8168 (32.4 KiB, 203 hits)
Because your new system probably does not have any network interface operating at this time, you will need to copy the files onto a pen drive and transfer this way.  To do this, copy the download archive file to a pen drive and then connect the pen drive to your new Elastix system.  You do not need to expand this file first, we will do that on the Linux box.  On the system console as root (or equivalent), you should see the USB device (your pen drive) display something like the following:
Vendor:  BUFFALO   Model: USB Flash Disk    Rev: 3.10
Type:   Direct-Access                       ANSI SCSI revision: 00
SCSI device sdb: 16121856 512-byte hdwr sectors (8254 MB)
sdb: Write Protect is off
sdb: assuming drive cache: write through
SCSI device sdb: 16121856 512-byte hdwr sectors (8254 MB)
sdb: Write Protect is off
sdb: assuming drive cache: write through
sd 3:0:0:0: Attached scsi removable disk sdb
sd 3:0:0:0: generic sgl type 0
I don’t know why it repeats a chunk of information, it just does.  Some of the information will change.  You need to make a note of your device on inserting where mine (above) says ‘sdb’, yours will probably be the same.  You now need to ‘mount’ the pen drive so it can be accessed.  First we need to create a dummy directory to ‘mount’ the pen drive and access through:
mkdir /mnt/pendrive
This is where will ‘mount’ and access the driver file from.  Next mount the pen drive with:
mount -t vfat /dev/sdb1 /mnt/pendrive
You may need to change the ‘sdb1′ part, if your pen drive was installed as a different device, check the information displayed when the pen drive was first connected.  You need to append the ’1′ to the device ID of ‘sdb’ to access the first partition.
We can then copy the files over to your home area with:
cp /mnt/pendrive/r8168-8.008.00.tar.bz2 ~
You will probably need to change the file name to match the version you have downloaded.  You can now ‘un-mount’ and ‘eject’ the pen drive with:
eject -v -s /dev/sdb1
And you should see a response like:
eject: device name is `/dev/sdb1′
eject: expanded name is `/dev/sdb1′
eject: `/dev/sdb1′ is mounted at `/mnt/pendrive’
eject: unmounting device `/dev/sdb1′ from `/mnt/pendrive’
eject: `/dev/sdb1′ is a multipartition device
eject: trying to eject `/dev/sdb1′ using SCSI commands
eject: SCSI eject succeeded
The pen drive can then be unplugged.  Now we can extract the archive, compile the drivers and install.  First change to your home drive with:
cd ~
Extract the archive, changing the file name if required:
tar vjxf r8168-8.008.00.tar.bz2
Change to the extracted archive directory, changing the name if required:
cd r8168-8.008.00
Compile and install with the following commands, checking for any errors at each stage:
make clean modules
make
make install
depmod -a
insmod ./src/r8168.ko
You can check whether the driver is loaded by using:
lsmod | grep r8168
And you should get something like:
r8168                  36884  0
You can then configure the interface for DHCP configuration or static by editing the following file in CentOS: /etc/sysconfig/network-scripts/ifcfg-eth0.
For a static address, edit the file to look something like:
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
TYPE=ethernet
NETMASK=255.255.255.0
IPADDR=192.168.1.1
GATEWAY=192.168.1.254
BROADCAST=192.168.1.255
Or for a dynamic DHCP address, then it should look like:
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
Reboot the system and all should be operational now.

No hay comentarios:

Publicar un comentario