If you are running a pfSense/any FreeBSD machine with a Realtek NIC, you may have noticed it randomly shits the bed when under load:
re0: watchdog timeout re0: link state changed to DOWN
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 64-bit versions of 1.95 for pfSense 2.4.4, 2.4.5, and 2.5.0; 1.96.04 for 2.4.5, 2.5.0, and OPNSense 20.7. If you have a different version and would like a precompiled module, let me know and I’ll build one for you.
As of November 19th, 2020: pfSense 2.5.0 has a package in the repo for the driver module:
realtek-re-kmod. You will still have to perform the
/boot/loader.conf steps, but the instructions are given in the shell after you run
pkg install realtek-re-kmod.
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 (1.1 MB)
- 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. pfSense 2.4.4 is 11.2, 2.4.5 is 11.3, 2.5.0-devel is 12.2.
commands to do this on your pfSense box (click me):
- Download the archive to your current working directory:
fetch -o realtek.zip https://sbforumsuploads.s3.dualstack.us-east-2.amazonaws.com/original/2X/f/ff27565e88c6e6846d3feecf683a90a25f5798dd.zip
- Copy (2.4.4):
cp realtekdrivers/11.2/1.95/if_re.ko /boot/kernel
cp realtekdrivers/11.3/1.96.04/if_re.ko /boot/kernel
cp realtekdrivers/12.0/1.96.04/if_re.ko /boot/kernel
You should use the latest version available in the package for your FreeBSD version if the guide text is not updated.
Change perms of the
chown root:wheel /boot/kernel/if_re.ko
chmod 0555 /boot/kernel/if_re.ko
/boot/loader.conf.local(may need to be created) 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 nanoto make this easy (you’d then
Enter the command
kldload if_re.koand if there’s no output, it’s been loaded (verify with
Reboot your machine and note how your Realtek interfaces don’t constantly kill themselves under load.