Install Ethernet driver on FreeNAS/NAS4Free (full-install)

FreeNAS supports the appropriate hardware of the FreeBSD-Version where FreeNAS is based on. But sometimes it is necessary to install a third-party or a self-compiled driver. This how-to describes how to install a downloaded binary Ethernet interface (NIC) driver on a “full installation” of FreeNAS/NAS4Free. It was written for non-experienced Unix users.

If you have installed FreeNAS/NAS4Free embedded, refer “Install Ethernet driver on FreeNAS/NAS4Free (embedded)” for details.

Requirements

  • Monitor
  • Keyboard
  • USB flash drive, Fat32-formatted  (to store the driver file temporarily)
  • FreeNAS has to be installed as “Full OS on HDD + DATA + SWAP Partition”. Otherwise – if you installed FreeNAS “embedded” –  the driver file will be stored in a RAM drive and after a reboot the driver is gone. But if you want to run FreeNAS “embedded” however refer Install Ethernet driver on FreeNAS/NAS4Free (embedded).
  • Binary driver file (*.ko) for the appropriate FreeBSD-Version on which your FreeNAS is based on.

Install Driver

This how-to shows how to install a available binary driver for the NICs RTL8111B, RTL8168B, RTL8111, RTL8168, RTL8111C, RTL8111CP, RTL8111D(L), RTL8168C, RTL8111DP, RTL8111E on FreeNAS 0.6x or 0.7x. 

  1. Download or compile the appropriate driver.
    For the NICs mentioned above volunteers compiled and published drivers . Refer the download section for details. Please note the different writing for the different driver filenames if_rl... and if_re... in the instructions #8 and #9!
  2. Copy the file to your flash drive. Take care that the drive was formatted with the Fat32 filesystem. That is in almost all cases the default filesystem on flash drives, so that you do not need to do anything in general.
  3. Connect the monitor and keyboard to your FreeNAS server.
  4. Start your server and choose option 6 (Shell) in the  console setup:

    Bildschirmfoto: Console Setup von FreeNAS

    Console Setup of FreeNAS

  5. Connect your flash drive to the server.
  6. The command
    dmesg | tail

    shows the name of the flash drive device, e.g. da2(see screenshot below).

    Ausgabe von: dmesg | tail

    Output: “dmesg | tail”

  7. Mount your flash drive:
    mount_msdosfs /dev/da2s1 /mnt

    The suffix s1 after da2 means the first slice on the device da2 (here:  USB flash drive). Read more about mounting in the FreeBSD manual – chapter 3.

  8. Copy the driver to the directory /boot/kernel:
    cp /mnt/if_rl.ko /boot/kernel

    If this command fails you may have a current Nas4Free/FreeNAS version installed. In newer versions kernel modules (drivers) are located in /cf/boot/kernel and /cf is mounted read-only. To address this circumstances you have to unmount /cf and remount it with read/write permissions. Than you can copy the driver.

    umount /cf && mount -o rw /cf
    cp /mnt/if_rl.ko /cf/boot/kernel
  9. To load the driver at boot time automatically append if_rl_load=„YES“ or if_re_load=„YES“ to the content of the file loader.conf:
    echo if_rl_load="YES" >> /boot/loader.conf

    or in newer versions

    echo if_re_load="YES" >> /cf/boot/loader.conf
    Optional: To load the driver temporarily, type:
    kldload /boot/kernel/if_rl.ko

    or

    kldload /cf/boot/kernel/if_rl.ko

    This is useful to check whether the driver will be loaded without errors. The command dmesg|tail shows the last system messages for checking. Please be advised that the driver will not be loaded after a reboot again. Therefore add the driver to the /boot/loader.conf as shown above.

  10. Reboot system (option 7 in console setup).

    Screenshot: Console Setup FreeNAS

    Console Setup of FreeNAS

Download

Below you find some ready-to-use (binary) drivers (for NICs with RTL8111B, RTL8168B, RTL8111, RTL8168, RTL8111C, RTL8111CP, RTL8111D(L), RTL8168C, RTL8111DP, RTL8111E), some volunteers thankworthy provided for a couple FreeNAS versions.

The drivers below may work on your system or not. Please read “Legal notice”  concerning liability for details.

[TABLE=5] For FreeNAS 8 I have not found any download sources at the moment. If you find a binary driver for FreeNAS 8 a brief message via mailor comment is highly appreciated.

Related Links

Picture Credits

Titleimage:
BSD Daemon by Diavolo Qqta (CC BY-NC-SA 2.0)
Ethernet NIC 100Mbit PCI“ by afrank99. CC BY-SA 2.0 via Wikimedia Commons.


43 comments

  • Hallo.
    Klasse Anleitung.
    Habe versucht eine Realtek 8169 dem Freenas (0.7.1 )hinzuzufügen, leider klappt das nicht.
    Beim kldload sagt mir freenas das die datei if_rl.ko nicht vorhanden ist 🙁

  • Hallo Felix,

    1. Wie lautet denn die genaue Fehlermeldung?
    2. Was sagt dmesg|tail nach dem Aufruf von kldload?
    3. Bist du sicher, dass du den richtigen Treiber zu deinem FreeNAS runtergeladen hast (32-/64-bit)? AFAIK basiert FreeNAS 0.7x auf FreeBSD 7.2. und nicht wie FreeNAS 0.69.x auf FreeBAS 6.4. Ein binärer Treiber für das eine System dürfte nicht auf dem anderen laufen.
    4. Wo hast du denn den Treiber runtergeladen?

    Kannst mir die Antworten auch mailen, wenn sie zu umfangreich sind.

    Hani

  • Hallo,
    ich habe Dienen Blog mit Freude gelesen und abgearbeitet. Super beschrieben! aber ich komme Leider trotzdem nicht weiter.
    Ich bekomme eine Fehlermeldung das das Format nicht ok ist.
    Ich vermute dass der von mir geladene Treiber nicht 64bit fähig ist. Kannst Du mir sagen wo ich einen 64bit Treiber für eine Realtek r8111e bekomme. Googel hat mir leider nicht weitergeholfen.

    Stefan

  • Hi Stefan,

    welche FreeNAS-Version nutzt du? Unterstützt die 0.7er nicht die 8111er?

    Vielleicht helfen ja die Tipps in dem Beitrag Realtek 8111b/c Driver / Atom MB im FreeNAS-Forum bei dir weiter.

    Was spricht eigentlich dagegen, die 32-bittige Version von FreeNAS einzusetzen? Dann könnte dein Problem elegant gelöst sein.

    Hani

  • Hi Hani,

    I keep getting the error link_elf:symbol m_gethdr undefined & kldload: can’t load.

    Can u help me out

    Jobin

  • Hi Jobin,

    Have not ever seen your error on my machine. I need a bit more information:

    Please tell me which FreeNAS-Version/architecture (0.6.x/0.7.x, x86/amd64) and NIC card do you use. And which driver did you downloaded and from where? Please send me the detailed error message.

    Hani

  • When I tried to use the linked driver you posted, the network card still didn’t work (For FreeNAS 0.7.2). However, I got the latest version of Realtek’s driver (1.80), and compiled it in FreeBSD 7.2, and made this new 32 bit driver. It works great for me, and your instructions work perfectly with a slight modification to use different module file name. Anyway, here is a link to my compiled module: https://files.me.com/twoslick/12js1a

  • Hallo,

    gibt es vllt. auch einen 64-bit Treiber für den RTL8111E Chipsatz?
    Ansonsten super Anleitung, hab sogar ich verstanden und ich wusste vor ner Woche nichtmal das es freeBSD gibt…

    Gruß Jonas

  • Hallo,

    würde die 32-bit Version problemlos laufen? Wenn ja spricht bei mir nichts dagegen. Könnte ja später immernoch umsteigen, zu FreeNas 0.8 Zeiten (wenn der Treiber dann implementiert sein sollte).

    Vielen Dank und ein großes Lob an deine Arbeit hier!

    Jonas

    • Mit Tim Rupes Treiber sollte es funktionieren. Du musst meine Anweisungen – wie beschrieben – bei Pkt. 8 und 9 noch anpassen: if_rl… durch if_re… ersetzen. Viel Erfolg, Hani

  • Can someone with a freebsd 64bit compile the driver please ?
    it can be found here : http://tinyurl.com/y9dkvnx

  • Hani,

    Could you please have a look at this post:
    http://sourceforge.net/apps/phpbb/freenas/viewtopic.php?f=9&t=7976&start=20#p40296

    It should be the 64bit driver for the RTL8111E.

    Can it be used in the how-to you described above, but this time for a 64bit install.

    I did not manage to get it working.

    But, I’m a newbee….

    Thanks for your great site!

    Willek

    • Sorry Wilvliet, I do not know whether it will work or not and I can not check it. By the way as I suggested in some of my German replies: What speaks against a 32-bit installation of FreeNAS even on 64-bit hardware? Regards, Hani

  • Hani, thanks for your reply. I also considered a 32bit installation. But, I got hands on old ethernet card. The 64bit installation is running now. I will wait until the 64bit driver for the RTL8111E has been incorporated in FreeNAS. Then the old card will be removed.
    Regards, Willek

  • Großartige Anleitung, danke das ihr euch die Arbeit für uns Unwissende macht.

  • Super Anleitung, funktioniert auf Anhieb. Wake on Lan wird allerdings wohl nicht unterstützt. Hast du da eine Lösung dafür?

  • Good day! Maybe somebody could make ready ISO with integrated drivers RTL8111E for i386, I’ll be very grateful.

  • Thanks for the info. You got me over the hump getting a raid driver installed into FreeNAS!!

  • I tried this today using the file from 7 above. I can’t get it work – I am getting an “Exec Format error”.

    I am trying to set up 0.7.2.5543 on a GA-D525TUD board (RTL8111E)

  • I think I just found my issue – and found a 64 bit driver. at http://zalil.ru/30224952

    Although this loads when I manually load it – I cannot get it to stick even when I don’t load it manually.

    After a reboot there are no interfaces there and I can’t even manually load it.

  • @pwapwap: Did you installed FreeNAS “embedded” or “full”?

    If you installed FreeNAS “embedded” refer https://sourceforge.net/apps/phpbb/freenas/viewtopic.php?f=9&t=6984&start=20#p7616. Otherwise the driver will be installed in the RAM disk and can not be loaded again after a reboot.

  • Danke erstmal fuer deine Anleitung.
    Bin natuerlich erstmal ueber den Part mit dem alternativen Treiber gestolpert, da ich ‘ne RTL8168B Karte habe.
    ich scheitere daran, die .ko Datei nach /boot/kernel zu kopieren. (read-only filesystem …)
    Ich vermute mal, ich habe mir die embedded version installiert?

    achso, ich nutze die 8er Version.

    hast du einen Tip fuer mich?
    Vielen Dank schon mal.

    Gruß,
    Alex

  • @Alex: ich kenne die 8.0-Version nicht. Da soll sich eine Menge geändert haben. Da diese Version auch auf FreeBSD 8 basiert, brauchst du natürlich auch einen Treiber , der für diese Version kompiliert wurde! Die hier für 0.6 und 0.7 genannten werden nicht funktionieren.

    Wenn du des Englischen mächtig bist hilft dir vielleicht die englische Kurzanleitung unter https://sourceforge.net/apps/phpbb/freenas/viewtopic.php?f=9&t=6984&start=20#p7616 weiter.

    Sollte das mit der 8.0 nicht funktionieren bzw. wenn du nur einen binären Treiber für die 0.7er hast, ist die Installation der älteren 0.7er FreeNAS-Version sicher nicht die schlechteste Lösung.

  • very useful article. helped me in fixing up my RTL8111E gigalan card under PFSense 1.2.3 version. Thanks dude.

  • Hi Hani,

    Trying to install this on FreeNas 8 but keep getting the following error when we run cp /mnt/if_rl.ko /boot/kernel

    cp: /boot/kernel/if+rl.ko: read-only file system.

    Any idea what i can do to resolve?

    THanks

    Shaun

  • @Shaun: The binary drivers mentioned on this blog are only for FreeNAS 0.6x and 0.7 32-bit, resp.

    FreeNAS 8 is based on FreeBSD 8 neither on FreeBSD 7 (FreeNAS 0.7x) nor on FreeBSD 6 (FreeNAS 0.6x).

    So you need a appropriate driver for your platform (FreeBSD 8). Please be advised that you need different drivers for 32-bit and 64-bit environments. I have not found any driver for this platform yet.

    Ask at http://sourceforge.net/apps/phpbb/freenas/ if someone has already compiled a driver for your platform.

    Kind regards, Hani

    PS: Maybe FreeNAS 0.7 fits our needs. For this version you find a binary driver for sure.

  • EN: For a 64-bit driver for FreeNAS 0.7x for the NIC’s RTL8111B, RTL8168B, RTL8111, RTL8168, RTL8111C, RTL8111CP, RTL8111D(L), RTL8168C, RTL8111DP, RTL8111E try http://sourceforge.net/apps/phpbb/freenas/viewtopic.php?f=9&t=7976&p=40100&hilit=hani#p40296

    DE: Ein 64-bit Treiber für FreeNAS 0.7x und die NICs RTL8111B, RTL8168B, RTL8111, RTL8168, RTL8111C, RTL8111CP, RTL8111D(L), RTL8168C, RTL8111DP, RTL8111E könnte der Treiber http://sourceforge.net/apps/phpbb/freenas/viewtopic.php?f=9&t=7976&p=40100&hilit=hani#p40296 funktionieren.

  • Hey

    i compiled a driver for my Free4Nas 9 64bit(based on FreeBSD 9)

    http://shareplace.com/?02715E1729

  • Hi Camerlengo or Hani—Do you have an updated d/l link for the FreeBSD 9/NAS4Free drivers? The one linked to off of this page appears to be broken. (Sending a RST when I click the link, after waiting for the counter to tick-down).

  • Shauncro,

    Make sure you make your FREENAS drive writable. Try this:

    mount -uw /

    Regards,
    Dan

  • New how-to for embedded installations available, refer: https://blog.hani-ibrahim.de/?p=1749

    Neues How-To für “embedded”-Installationen verfügbar: https://blog.hani-ibrahim.de/?p=1749

  • How-To aktualisiert: “file exist” Fehlermeldung bei aktuellen Versionen. Danke an Markus für den Hinweis.

    How-to modified: Address “file exist” error. Thanks to Markus for pointing me to this isssue.

  • Hi Hani,
    ich habe diesen Thread mit freude gelesen!
    Im Ansatz bin ich auch schon so weit, das der Treiber vermeintlich geladen wird, wenn ich mir jedoch ein dmegs anzeigen lasse müsste ich doch eigentlich sehen, dass er folgende Zeile anzeigt: “re0: version:1.88” Hier ist auch ein Link zum Thread im Bug-Tracker: https://bugs.freenas.org/issues/1850 in diesem findet sich auch der aktuelle Treiber 1.88 precompiled. Leider bekomme ich es einfach nicht hin.
    Hast du noch eine Idee?
    Danke schon mal & Grüße
    Christian

    • Hallo Christian,

      zuallererst, ich benutze FreeNAS (auch nicht in einer VM) nicht mehr und kann deshalb auch dein Problem nicht praktisch nachvollziehen.

      Nur zu meinem Verständnis: Du hast einen 64-bit Prozessor und ein 64-bit FreeNAS installiert! Der Treiber von deiner geposteten Seite wird mit

      kldload /boot/kernel/if_rl.ko

      ohne Fehlermeldung geladen?! Soweit so gut. Warum glaubst du das der Treiber nicht richtig geladen wurde. Bekommst du keine Netzwerkverbindung?

      Was gibt den

      dmesg | tail

      nach der Laden mit “kldload” aus? Wenn es da mit dem Laden nicht geklappt hat, sollten hier Fehlermeldungen zu sehen sein.

      LG Hani

  • It? such as yo? learn m? mind! You appear to grasp a lot about this, like you wrote th? e book ?n it o? som?thing.
    I bel?eve t?at you just can do w?t? a few % to pressure the message
    ?ome ? ?ittle bit, ?ut ?ther th?n that, t?at ?s
    wonderful blog. An excellent read. ?’ll certainl?
    b? back.

  • Hey, just wanted to say thanks for this. This post taught me a lot. Do you happen to know how/where I could find the kernel modules here built for FreeBSD 10? Looking to avoid the watchdog timeouts using pf and the dmesg | tail output says I have a kernel mismatch when using the 9 version.
    Danke!

  • i am using freenas 6.4 release now i change motherboard so lan is not working. kindly send ZEB-945 motherboard lan driver

    • Please be advised that this site is neither an official FreeNAS nor an official Zebronics Website. I am a private person who used FreeNAS a couple years ago but I do not use it anymore. I can only provide the drives you find here.

      Please contact your motherboard supplier Zebronics regarding drivers. They are responsible. Thank you and good luck.

Leave a Reply to pwapwap Cancel reply

Your email address will not be published. Required fields are marked *