Install Ethernet driver on FreeNAS/NAS4Free (embedded)
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. My how-to “Install Ethernet driver on FreeNAS/NAS4Free (full-install)” shows how to install a downloaded binary Ethernet interface (NIC) driver on a full installation of FreeNAS/NAS4Free. This how-to describes the same for the embedded platform. It was written for non-experienced Unix users.
- USB flash drive, Fat32-formatted (to store the driver file temporarily)
- FreeNAS has to be installed as “embedded”. If you have installed FreeNAS/NAS4Free as “Full OS on HDD + DATA + SWAP Partition” see the how-to “Install Ethernet driver on FreeNAS/NAS4Free (full-install)” for details.
- Binary driver file (*.ko) for the appropriate FreeBSD-Version on which your FreeNAS is based on.
- Computer/Tablet/etc. with web browser that is connected to same network as the server (to access the web administration of FreeNAS/NAS4Free).
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.
- 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_re...in the instructions #8, #14 and #16!
- 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.
- Connect the monitor and keyboard to your FreeNAS server.
Start your server and choose option 6 (Shell) in the console setup:
Connect your flash drive to the server.
- The command
dmesg | tail
shows the name of the flash drive device, e.g.
da2(see screenshot below).
Make a directory “usb” in “/mnt” and mount your flash drive:
mkdir /mnt/usb mount_msdosfs /dev/da2s1 /mnt/usb
da2means the first slice on the device
da2(here: USB flash drive). Read more about mounting in the FreeBSD manual – chapter 3.
Load the driver temporarily first:
kldload /mnt/usb/if_rl.koIf your system throws an error as “file exists” you may have a newer FreeNAS/NAS4Free version installed. It is likely that a already installed kernel module of the same name interferes with yours.
As far as I know it is impossible to overwrite this driver on an embedded installation of FreeNAS/NAS4Free. Because the driver in question is loaded at every boot time from the operating system image again. A workaround is the full installation of FreeNAS/NAS4Free only. Refer my how-to Install Ethernet driver on FreeNAS/NAS4Free (full-install).
- Quit the shell by typing exit.
- Back in the main menu type 1 for “Assign interface and select your interface” and then choose the appropriate adapter (rl0) and follow the wizzard.
- When you are back to the main menu type 2 for “Set LAN IP address” and enter the IP-address of your FreeNAS/NAS4Free server, e.g.
192.168.111.250. The address must fit to your network.
- Again back to the main menu choose option 6 to start a shell.
- Be sure that you have already setup a share on your server (Got to the web administration, eg.
http://192.168.111.250to do the job). If you do not know how to do this, refer the documentation of FreeNAS/NAS4Free for details. Lets say that your share is in /mnt/network.
- Copy the driver to the share. I recommend to copy it in a seperate directory (folder), e.g. “system“. If your share is in /mnt/network:
mkdir /mnt/network/system cp /mnt/usb/if_rl.ko /mnt/network/system/
- Open a web browser on a separate computer/tablet/etc. and open the web administration.
- In order to start the driver automatically go to “System|Advanced|Command scripts” add a new script and fill in e.g.
kldload /mnt/netzwerk/system/if_re.koin the field “Command” and “PostInit” in “Type”. Click “Save” and close the web administration.
- Back to your server’s main menu, reboot it by choosing option 7. The driver should be loaded automatically after reboot.
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.
- Unix driver (source code) for RTL81xxxx – Realtek Homepage