FreeNAS and Realtek RTL8168C/RTL8111DP/RTL8111E network card
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.
This entry was posted by Kristijan on November 12, 2010 at 10:56 pm, and is filed under NAS. Follow any responses to this post through RSS 2.0.You can leave a response or trackback from your own site.
-
#2 written by Malcolm 1 year ago
-
Hi Malcolm,
No luck on my end either trying to get this working.
I tried:
# ifconfig re0 wakeon magicFound that when I was randomly Googling, but it seemed to just bring down the NIC. I have no experience with WOL, so I’m not entirely sure on how to go about configuring it.
In any case, this was the forum topic in question [1].
[1] – http://sourceforge.net/apps/phpbb/freenas/viewtopic.php?f=9&t=986
-
#6 written by Leo 1 year ago
-
#9 written by tom 1 year ago
-
-
I just did a quick google [1], and found a user having the exact error on the FreeNAS forums. They come to the same conclusion about the 32/64bit processor, but there wasn’t anything about a resolution.
[1] – http://sourceforge.net/apps/phpbb/freenas/viewtopic.php?f=12&t=1677
-
-
#12 written by Ruslan 1 year ago
Hi, Kristijan,
I just compiled the Realtek 8111 driver for my FreeNAS system running on GA-D525TUD mobo (AMD64 platform). Works just fine.
Thanks for the inspiration. I saved the driver at http://zalil.ru/30224952 (temporary location). -
-
#18 written by Monte Beery 1 year ago
I’m a novice to both linux and FreeNAS so please be patient and explicit.
I’ve assembled a FreeNAS box using the Gigabit Intel Atom board (GA-D525TUD) and thus have a Realtek RTL8111E NIC.
I’m using a FreeNAS image on an internally mounted USB flashdrive.
I’ve downloaded your compiled driver version 1.80 from above and have it on a usb drive.
FreeNAS boots fine, I exit to Shell and execute your first two commands, mkdir and dmesg. The dmesg command results in a page of info, but ultimately ends with the da1 info you describe above and it corresponds to the usb drive.
The problem is with the next command:
# mount_msdosfs /dev/da1 /mnt/usbThis returns an error message:
mount_msdosfs /dev/da1: : Invalid arguementSuggestions?
Is this related to the fact that I’m using another usb drive for the FreeNAS boot?thanks,
Monte-
Hi Monte,
Using the mount_msdosfs command assumes that the USB drive is formatted with the FAT32 filesystem. It’s pretty common to have FAT32 formatted USB drives when coming over from a Windows environment, but if you’re using some like NTFS, you can follow a later post of mine about mounting NTFS drives.
Another thing, if your USB drive is partitioned in any way, then you need to tell it which partition you want to mount. I guess an easy way to do this is:
* Plug the USB key in.
* Run the following command: # ls -l /dev/da1*
* See if it outputs anything other than /dev/da1 and try and mount that instead.Let me know how you go.
-
-
#20 written by Boris 1 year ago
Hi!!
i have a problem with the loading of the if_re.ko. i use a old lan card to copy if_re.ko the local disk on NAS.nas:/# kldload /mnt/oiikj/
Backup steam/ Movies/ if_re.ko* torrents/
Knjige/ fuppes.db mp3/
nas:/# kldload /mnt/oiikj/if_re.ko
nas:/# kldstat
Id Refs Address Size Name
1 6 0×80400000 b134e4 kernel
2 1 0x80f14000 6a4f0 acpi.ko
3 1 0×83561000 123000 zfs.ko
4 1 0×83684000 3000 opensolaris.ko
5 1 0x8377d000 19000 if_re.koI editeed the loader.conf and add just if_re_load=”YES”
kernel=”kernel”
bootfile=”kernel”
kernel_options=”"
kern.hz=”100″
if_re_load=”YES”But on next reboot
nas:~# kldstat
Id Refs Address Size Name
1 6 0×80400000 b134e4 kernel
2 1 0x80f14000 6a4f0 acpi.ko
3 1 0×83519000 123000 zfs.ko
4 1 0x8363f000 3000 opensolaris.ko -
-
#23 written by Aberanta 1 year ago
-
#27 written by Joel 1 year ago
Hey Guys,
I have had success in all of the steps until where I have to copy the if_re.ko file to a location which would be safe from overwrites. heres where it went wrong:
# df /cf
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/da0s1 2028552 71660 1956892 4% /cf# mount -o rw /dev/da0s1 /cf
mount: /dev/da0s1 : Operation not permittedI’m at a loss and I’ve been working on this for weeks, so does anyone have an idea? I’m running a USB drive with the freeNAS liveCD, and I created with usb with unetbootin if that makes a difference.
Thanks!
-
-
#29 written by Joel 1 year ago
Hi Kristijan,
Thanks for replying so quickly. I only have an error upon the last command you mentioned, here is the exact response I get:
# mount -o rw /dev/da0s1 /cf
GEOM_LABEL: Label msdosfs/FREENAS removed.
GEOM_LABEL: Label for provider da0s1 is msdosfs/FREENAS
mount: /dev/da0s1 : Invalid argumentI’m in way over my head here, so I apologize if this is a rudimentary question.
Thanks!
-
Hi Joel,
Hmm, I haven’t encountered this problem before, so I’m not quite sure. What happens if you don’t specify the device and let it read out of /etc/fstab
# mount -o rw /cf
Failing that, I’d go ask in the FreeNAS forums, as they would have a better clue. Just out of curiosity, what version of FreeNAS are you running?
-Kristijan
-
#31 written by Joel 1 year ago
Hey Kristijan,
I’m using version 0.7.1.5024 i386 live CD. I know its not the most recent stable build, but I’ve had trouble making anything else work properly.
Here’s what I got:
# mount -o rw /cf
mount: Using “-t msdosfs”, since “-tmsods” is deprecated
GEOM_LABEL: Label msdos/FREENAS removed.
g_vfs_done():da0s1[WRITE(offset=136912, length=4096)]error = 1the last line keeps repeating every ~20 seconds
Thanks so much for your help, I am going to post this issue on the freeNAS forums and see what’s up.
-Joel
-
-
-
-
-
#33 written by Ethan 1 year ago
Hey guys ,
first sorry for my english but i’m a newbies french :p
i had the same problem with the last version (7.2)
you don’t have to mount /umount
juste cp if_re.ko in /boot/kernel (and not /cf/boot/kernel) and add if_re_load=”YES” to /boot/loader.conf
i hope this will work for you as it was working for me
see ya
-
Hi,
Have you tried setting an MTU higher than 1500 (jumbo frames)? On my Linux server running on identical hardware I can set it as high as 7200 (but not 9000 unfortunately). With the 64bit driver from an earlier comment I only get the following:
nas1:~# ifconfig re0 192.168.26.5 mtu 1501
ifconfig: ioctl (set mtu): Invalid argumentDoes anyone know if there is a way to get around this limitation?
Andrew -
#35 written by AuthUser 1 year ago
RE: setting MTU 9000 (jumbo frames) with realtek 64bit driver
I don’t think there is a way to do this, it looks like the realtek driver is just badly written and it is currently impossible to set the mtu over 1500 when using it.
I even looked at backporting the re(4) driver (which has suppot for the realtek 8111e..etc) from freebsd 7.4 (compiled as a separate module) and seems that is impossible too.
I ended up moving to freenas 8.0 which has a far better realtek driver that can utilize mtu 9000 on 64 bit, greatly improved my read/write speeds. Just make sure to get the updated kernel from freenas after you install 8.0 final if you do.
-
-
#37 written by AuthUser 1 year ago
I haven’t had any issues with zfs in 8.0, from what I have read freenas is completely zfs focused in 8.0. Did you have a link to anyone discussing drive failure + recovery issues in 8.0?
Here is my 0.7.2 64-bit vs 8.0 final (with updated kernel) 64-bit speeds:
0.7.2:
write: 40MB/sec
read: 50MB/sec8.0:
write: 60MB/sec
read: 70MB/secI’m running an intel atom mini-atx setup with 7-drives in raidz2.
Being able to set mtu 9000 for jumbo frames makes a pretty big difference in speed and lowers cpu usage (smaller number of packets to handle).
-
-
-
#38 written by JCozza 1 year ago
-
#40 written by Brandon 9 months ago
I get this on FreenNAS 8.0 amd64:
module_register_init: MOD_LOAD (pci/if_re, 0xffffffff805a2370, 0xffffffff81042420) error 22
Any ideas ?
I get very similar to what other folks are getting as well in dmesg:
re0: port 0xe800-0xe8ff mem 0xdcfff000-0xdcffffff,0xdcff8000-0xdcffbfff irq 17 at device 0.0 on pci4
re0: Using 1 MSI messages
re0: Chip rev. 0x2c800000
re0: MAC rev. 0×00000000
re0: Unknown H/W revision: 0x2c800000
device_attach: re0 attach returned 6 -
#42 written by Jarrod 6 months ago
Brilliant. Was despairing about my E35M1-I, but found this post. Well written and easy to follow even for a newb like me. The response about problems mounting the usb because the stick might be partitioned was particularly helpful. Had to change one line in the loader.conf to accommodate the amd64 change which seemed to work.
if_re_amd64_load=”YES”Thanks very much.
-
#43 written by Andy 5 months ago
I’m trying to install PFSense 2.0 Final and i have Realtek 8111E on my Asrock H61DEL (chose this board because of multiple PCI-E x1 ports for interfaces). I have 3 Intel PRO/1000 wich turn on fine. But the Realtek dosen’t want to work. i have tried everything. I use the 64bits edition. Please HELP me.
Thanks,
Andy -
#45 written by Nathaniel 2 months ago
Thanks very much Kristijan and Ruslan. I bought an Intel Atom BOXD525MW motherboard to run FreeNAS. My brother used the 510 with no complaints, and they share chipsets (but not onboard NICs) so I didn’t expect any issues. I was upset when I encountered this issue, even more so when I found message boards claiming the driver couldn’t be added without rebuilding the entire image.
Your method worked for me without a hitch the very first time. Thank you.
-
#46 written by Misha 3 weeks ago
Hi Kristijan,
I’ve done everything what you said, but unfortunately I haven’t any success to get my network on Freenas 7 (the latest stable release 0.7.2.8191)…
after reboot when I type kldstat, I have:
kernel
isboot.ko
if_re_amd64.kobut my lan is still
LAN -> lo0
and when I try to assign interfaces (1)
nothing happened, I don’t have any option to choose re0, just Auto-detection, and nothing detected. Something is very strange, because there’s no green light on my network card….I tried 8.0.4 version of NAS, and everything work perfect…but there’s no uPNP, bittorrent etc…
Any idea?
Thanks
-
#47 written by David G 1 week ago
FreeNAS v7.2 has its advantages over v8, and I’m happy I found this site. BIG THANKS!!!
It’s the first time I try FreeBSD and there were a few differences from what you wrote at the end:
I had to type “cd ..” to get to the “real” root for some reason, and even tho the directory cf existed there, the KO files were not in it but in /boot/kernel. And I didn’t have to unmount/mount any directory. For editing the file I used the editor “vi”.
-
#49 written by Joel 1 year ago
Hey Kristijan,
It turns out my problem was that I created my LiveUSB on Windows with unetbootin, which installed its own bootloader. I extracted a freeNAS.img file to usb from freeBSD, and then I was able to copy if_re.ko to /cf/boot/kernel. It was there upon reboot, so it worked!
Now, my only issue is that when I try to save changes to loader.conf to make the driver boot with the system it wont let me because loader.conf is read-only. Do you have a solution for this?
Thanks again,
Joel -
- Comment Feed for this Post
Excellent HOWTO kristijan. It exactly works as you described it. Now enjoying my freenas!
Thanks!