Quick links to compiled v1.80 drivers
Ethernet Driver for Intel
Ethernet Driver for AMD64 (Thanks to Ruslan)

As I mentioned in a previous post, I built myself a NAS based on FreeNAS. It’s been rock solid for about 3 weeks now, no hiccups. One initial issue I did have was getting the RTL8168C/RTL8111DP/RTL8111E network card chipset to work. There is no FreeNAS out of the box support for this chipset, so I had to compile my own from source found on the Realtek website which you can find here. If you have issues downloading or compiling it, I’ve compiled version 1.80 which you can download from the top of this page. Ruslan has kindly compiled an AMD64 version as well.

First and foremost, verify that the module actually works and you can bring up your network card and get some activity over it. I’m going to assume at this point that you have no way of copying something onto your FreeNAS other than USB, so copy if_re.ko to a USB stick and plug it into your NAS.

To mount the USB device, let’s first create a mount point.

# mkdir /mnt/usb

Now we need to find the USB device you just plugged in.

# dmesg
...
umass1: <USB 2 Flash Disk, class 0/0, rev 2.00/0.00, addr 3> on uhub4
da1 at umass-sim1 bus 1 target 0 lun 0
da1: <USB 2.0 Flash Disk 2.20> Removable Direct Access SCSI-2 device 
da1: 40.000MB/s transfers
da1: 119MB (244480 512 byte sectors: 64H 32S/T 119C)

What we’re looking for here is the da1

# mount_msdosfs /dev/da1 /mnt/usb

Now let’s see if we can load the module.

# kldload /mnt/usb/if_re.ko

If you don’t get any errors, you should see the module loaded.

# kldstat
Id Refs Address    Size     Name
 1   12 0x80400000 b134e4   kernel
 2    1 0x80f14000 195b4    if_re.ko
 3    1 0x8c32e000 e350     isboot.ko
 4    1 0x8c33d000 6a4f0    acpi.ko
 5    1 0x92284000 123000   zfs.ko
 6    1 0x923a7000 3000     opensolaris.ko
 7    1 0x92843000 4000     geom_nop.ko
 8    1 0x938cf000 9000     aio.ko
 9    1 0xa8768000 13000    geom_vinum.ko

So far so good, now bring up the interface and see if you can assign an IP address to it and ping another node on your network.
Sweet, all good, all we need to do now is copy the module to a location that isn’t going to get overwritten at boot, and edit loader.conf.

/cf is the filesystem where we will copy the module to, but it’s mounted as read only on boot, so let’s remount it as read/write.

# df /cf
Filesystem 1K-blocks  Used Avail Capacity  Mounted on
/dev/da0a      71062 64438  6624    91%    /cf

Substitue /dev/da0a to match your install.

# umount /cf
# mount -o rw /dev/da0a /cf

Copy if_re.ko from the USB to /cf/boot/kernel

# cp /mnt/usb/if_re.ko /cf/boot/kernel

Edit /cf/boot/loader.conf and add the following line.

if_re_load="YES"

That should be it, you can now unmount the USB stick which you used to copy the module and reboot. If all goes well, your network card should come up on boot. If you do have any issues with this, please post to the comments.