Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save dev-id/085dd2aae4913e552859fd2111b30bcc to your computer and use it in GitHub Desktop.

Select an option

Save dev-id/085dd2aae4913e552859fd2111b30bcc to your computer and use it in GitHub Desktop.
compile realtek network driver for pfsense 2.4.x

Based on:

  1. Download FreeBSD 11.1 VMDK and create a VM with it as HDD:

    https://download.freebsd.org/ftp/releases/VM-IMAGES/11.1-RELEASE/amd64/Latest/FreeBSD-11.1-RELEASE-amd64.vmdk.xz

  2. Get FreeBSD source tree and uncompress it to /usr/src:

    fetch -o /tmp ftp://ftp.freebsd.org/pub/`uname -s`/releases/`uname -m`/`uname -r | cut -d'-' -f1,2`/src.txz
    tar -C / -xvf /tmp/src.txz
  1. Download Realtek latest driver:

    http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=5&PFid=5&Level=5&Conn=4&DownTypeID=3&GetDown=false

  2. Uncompress driver:

    tar xvzf 0007-rtl_bsd_drv_v194.01.tgz
  1. Make driver:
    cd rtl_bsd_drv_v194.01
    make
1. If the last command fails, change the following line in file if_re.c

From: `#include <dev/re/if_rereg.h>`

To: `#include if_rereg.h"`
  1. Copy the file if_re.ko to the /boot/kernel folder in pfSense device.

    scp if_re.ko root@<pfSense device IP>

  2. Change file permissions in if_re.ko file accessing through SSH to pfSense.

    chmod 555 /boot/kernel/if_re.ko

  3. Modify /boot/loader.conf.local file and add the following line at the end of the file: if_re_load="YES"

  • Through console: vi /boot/loader.conf.local
  • Through web: Diagnostics > Edit File and click Load. When finished editing click Save.
  1. Reboot pfSense.

  2. After restart, verify if module is installed through ssh. Example execution:

    [2.4.2-RELEASE][[email protected]]/root: kldstat
        Id Refs Address            Size     Name
         1    7 0xffffffff80200000 2c3ea98  kernel
         2    1 0xffffffff82e3f000 80900    if_re.ko
         3    1 0xffffffff83021000 46c6     cryptodev.ko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment