[Guide] Resolve Realtek NIC Stability Issues

If you (for some reason) are running a pfSense machine with a Realtek NIC, you may have noticed it randomly shits the bed when under load.

Well, the default drivers in the FreeBSD kernel are older than dirt and god awful (if you mention this to them they get real confrontational), and Netgate won’t touch vendor driver distribution with a 10 foot pole. When the NIC is under load, it doesn’t respond to the software watchdog in time, and is reset. Happens with increasing frequency with a constant load, until it starts happening about 100 times a minute and the connection never comes back up.

Good news: you can load your own driver module that fixes this. I’ve uploaded a version for pfSense 2.4.4 and 2.5.0. If you have a different and would like a precompiled module, let me know and I’ll build one for you.

I am assuming you are using the shell. You can also use the virtual shell in the UI (Diagnostics->Command Prompt) along with the file editor and do the same stuff.

realtekdrivers.zip (275.6 KB)

  1. Download, unzip, and copy the module that matches your FreeBSD version (uname -rs) to /boot/kernel. Download it to your desktop and use SCP to copy it, or download it to your pfSense machine via fetch/curl/etc. [realtek drivers.zip|attachment] pfSense 2.4.4 is 11.2, 2.5.0-devel is 12.0.
commands to do this on your pfSense box:
  1. Download the archive to your current working directory: fetch -o realtek.zip https://forums.serverbuilds.net/uploads/short-url/i750qJ20XaAGAN9GsdWXckhp2b9.zip
  2. Extract: unzip realtek.zip
  3. Copy (2.4.4): cp realtekdrivers/11.2/1.95/if_re.ko /boot/kernel
  4. Copy (2.5.0): cp realtekdrivers/12.0/1.95/if_re.ko /boot/kernel
  1. Change perms of the if_re.ko file:

    chown root:wheel /boot/kernel/if_re.ko
    chmod 0555 /boot/kernel/if_re.ko

  2. Edit /boot/loader.conf.local and add the line if_re_load="YES" I think it only has Vi by default, which is extremely annoying if you’re not familiar with it, so you can pkg install nano to make this easy (you’d then nano /boot/loader.conf.local).

  3. Enter the command kldload if_re.ko and if there’s no output, it’s been loaded (verify with kldstat)

  4. Reboot your machine and note how your Realtek interfaces don’t constantly kill themselves under load.

1 Like