[Guide] Resolve Realtek NIC Stability Issues on FreeBSD - FreeNAS/TrueNAS, pfSense (2.4.4, 2.4.5, 2.5.0) + OPNSense, use 2.5Gb Realtek

Finally!

Hopefully ok to ask this question here… Been looking at building pfSense box. Heard so many stories of issues with Realtek nics. I have been looking at using Lenovo M90n IOT which used Realtek RTL8111K and RTL8111H. Can these be used and get stability and throughput? Looking to use with 1gb symmetrical connection.

Using these drivers will resolve any stability issues, and the i3-8145u in the M90n IOT will route symmetric gigabit.

Will the 4gb ram be enough. New to this and just starting off with buying hardware.

Absolutely. I have 4 in mine, and I also make extensive use of some packages and RAM usage is less than 70%

Thanks @bob and and @Riggi for feedback. I would be using pfSense with snort or suricata.

Don’t want to limit myself. Biggest thing that had stopped me from getting this was feedback on the Realtek drivers all over the forums and the inability to handle 1gb line rate.

I had been contemplating a build with sff pc but the lower power and quiet of this unit are big benefits!

I am testing OPNsense right now with the Lenovo M90n IoT as well.

The issue with the Realtek 2.5GbE (which I also have) is the chipset is overheating at full load and either freezing or throttling down to 1Gbps which provides low speeds. Windows users who know where to look have been changing the power save/eco mode and getting stability. OEM’s received new beta drivers from Realtek 2 weeks ago that appears to be working.

Most people don’t know where to set the power mode (nor do I) in *nix on these chipsets, so a new driver set that manages them better and maintains the throughput is very welcome and appreciated.

You have > 1GbE internet service?

makeshift solution for your m90n:

keeps mine at a cool 35C :wink:

also, i’m running OPNsense 20.7.5, how to validate driver used in FreeBSD… not sure the right command.

nvm! (dmesg | grep “re0”)

re0: port 0x4000-0x40ff mem 0xa1304000-0xa1304fff,0xa1300000-0xa1303fff at device 0.0 on pci2
re0: Using Memory Mapping!
re0: Using 1 MSI-X message
re0: ASPM disabled
re0: version:1.96.04
re0: Ethernet address: 98:fa:9b:23:e9:65
re0: Ethernet address: 98:fa:9b:23:e9:65
re0: link state changed to UP
re0: promiscuous mode enabled
076.108607 [1130] generic_netmap_attach Emulated adapter for re0 created (prev was NULL)
076.117463 [1035] generic_netmap_dtor Emulated netmap adapter for re0 destroyed
076.127751 [1130] generic_netmap_attach Emulated adapter for re0 created (prev was NULL)
076.209447 [ 320] generic_netmap_register Emulated adapter for re0 activated
509.294073 [ 295] generic_netmap_unregister Emulated adapter for re0 deactivated
509.302265 [1035] generic_netmap_dtor Emulated netmap adapter for re0 destroyed

The FreeBSD driver that resolved stability with their 8125 (and gigabit) NICs was released in last July, and the problems occurred regardless of temperature. The kernel driver was 1.94, from several years before the release of those 2.5Gb NICs. The Windows driver is a separate entity, and a workaround being eco-mode-related does not indicate a temperature problem.

This is atrocious. Why have you paid a premium for a small form factor device and then done this to it?

1 Like

Riggi, thanks for your work on this. I’ve had these drivers installed for over a week and haven’t experienced any issues.

1 Like

I’d love to know what cooling issues it’s having in stock config with pfsense, of all things.

I don’t think I’ve seen it break 30c. Stays around 27, in room an ambient near 75F.

Added a binary package with updated Realtek interface drivers #11079

Releases — 21.02/2.5.0 New Features and Changes | pfSense Documentation (netgate.com)

@Riggi Thanks man for your invaluable help!

Could you please post the driver for OPNSense 21.1.1?

Thanks in advance

Yep, the 2.5.0 re package had been mentioned in the thread for some time - nice that 2.5.0 is official now for folks with those NICs.

Hi @JairoAV25, OPNSense should have these drivers built-in since 20.7.4.

Do you know/ or can compile this driver ‘RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller’ I seem to have the slow performance on opnsense ver 20.7.4. Reading the comments i see that it mentions RTL812xx, but nothing specific on 8111.

Hello,

Thanks for this guide !

Very helping, but I have something strange with my Odroid net card and the motherboard Odroid H2+ …

I executed pkg install realtek-re-kmod

[2.5.0-RELEASE][root@pfsense]/root: pkg install realtek-re-kmod
Updating pfSense-core repository catalogue...
pfSense-core repository is up to date.
Updating pfSense repository catalogue...
pfSense repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        realtek-re-kmod: v196.04_2 [pfSense]

Number of packages to be installed: 1

The process will require 1 MiB more space.

Proceed with this action? [y/N]: y
[1/1] Installing realtek-re-kmod-v196.04_2...
[1/1] Extracting realtek-re-kmod-v196.04_2: 100%
=====
Message from realtek-re-kmod-v196.04_2:

--
Add the following lines to your /boot/loader.conf
to override the built-in FreeBSD re(4) driver.

if_re_load="YES"
if_re_name="/boot/modules/if_re.ko"

By default, the size of allocated mbufs is enough
to receive the largest Ethernet frame supported
by the card.  If your memory is highly fragmented,
trying to allocate contiguous pages (more than
4096 bytes) may result in driver hangs.
For this reason the value is tunable at boot time,
e.g. if you don't need Jumbo frames you can lower
the memory requirements and avoid this issue with:

hw.re.max_rx_mbuf_sz="2048"
[2.5.0-RELEASE][root@pfsense]/root:

Then as indicated in the message vi /boot/loader.conf for add

if_re_load="YES"
if_re_name="/boot/modules/if_re.ko"

So, I have

[2.5.0-RELEASE][root@pfsense]/root: cat  /boot/loader.conf
kern.cam.boot_delay=10000
kern.ipc.nmbclusters="1000000"
kern.ipc.nmbjumbop="524288"
kern.ipc.nmbjumbo9="524288"
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
opensolaris_load="YES"
zfs_load="YES"
if_re_load="YES"
if_re_name="/boot/modules/if_re.ko"
autoboot_delay="3"
hw.hn.vf_transparent="0"
hw.hn.use_if_start="1"

And

[2.5.0-RELEASE][root@pfsense]/root: kldstat
Id Refs Address                Size Name
 1   14 0xffffffff80200000  3aea538 kernel
 2    2 0xffffffff83ceb000     a448 opensolaris.ko
 3    1 0xffffffff83cf6000   3bb7f0 zfs.ko
 4    1 0xffffffff840b2000   11e230 if_re.ko
 5    1 0xffffffff85121000     1000 cpuctl.ko

So for me, no problem. But

[2.5.0-RELEASE][root@pfsense]/root: ifconfig -l
re0 re1 re2 enc0 lo0 pfsync0 pflog0

He noes not miss ``re3 re4 re5` ? :astonished:
And I guarantee you that only the first port of the net card works! When I connect a cable to any port other than re0, re1 or r2, I have no networks (and the leds remain off).
I don’t understand, I forgot something or …? :thinking:

Thanks for your help