Add native Realtek RTL8157 USB 5GbE support to TrueNAS SCALE

Problem/Justification
6.18.23-production+truenas, as well as 25.10.5 / 25.10.4

Does not correctly bind a Realtek RTL8157 USB 5GbE adapter (0bda:8157) to the r8152 driver. The adapter instead binds to cdc_ncm, preventing it from functioning as a normal 5GbE interface with the intended Realtek driver.

Users currently have to compile and install an unsigned, out-of-tree kernel module manually. That conflicts with TrueNAS’s appliance model, requires boot-time scripts, and must be repeated whenever the TrueNAS kernel changes.

Tested workaround and evidence

I built Realtek’s r8152 driver version 2.22.1 specifically for: 6.18.23-production+truenas

The replacement module:

Contains aliases for USB ID 0bda:8157, Successfully replaces cdc_ncm, Binds the adapter to r8152, Reports driver version v2.22.1 (2026/06/03), Advertises 5000baseT/Full

and successfully establishes a full-duplex link

This demonstrates that the adapter and current TrueNAS kernel are compatible when an appropriate r8152 driver is supplied.

Impact
(How is this feature going to impact all TrueNAS users? What are the benefits and advantages? Are there disadvantages?)

User Story
As a TrueNAS scale user with a small lab that has limited or no available PCIe expansion, I want to connect an RTL8157-based USB 5GbE adapter and have TrueNAS recognize it automatically. I’m using a HP microserver gen8 with only one pcie slot and a limted budget to move to 5 gig networking.

After connecting the adapter, it should appear as a network interface and negotiate at 5Gbps without enabling developer mode, installing an unsigned kernel module, or modifying the operating system. A cheap $29 USB C or A USB-ethernet adapter now works, where prior versions of Truenas resulted in a half duplex device that didn’t pull an IP or communicate at any speed. Now for ~$175 you can have a 12GBs SAS NAs array with 8 secondhand flash SAS drives and a killer shared storage network over a cheap and fast RTL8157.

TrueNAS: SCALE 26.0.0-BETA.2
Kernel: 6.18.23-production+truenas
USB vendor/product ID: 0bda:8157
Working driver: Realtek r8152 2.22.1
Working link mode: 5000baseT/Full

Related Posts:

(I can’t link since I’m new, but forums.truenas dot com /t/usb-c-5gbe-adapter-installation/45602)
I’m definitely not the only one who’d like to see it.

As best as I can tell, the ask here is to include the out of tree Realtek r8152 DKMs driver in TN26, to support newer Realtek chipsets such as the 8157 and 8159. Support for those moved in tree with kernel 7.1 and 7.2 respectively, and so would be included in TN27 when it adopts the 2026 LTS kernel.

Including out of tree drivers in the build comes with the usual tradeoffs re supporting that additional driver, vs the in tree one.

There is also a related FR here with a JIRA ticket.

Sorta related. Bringing in a newer firmware package from backports is a different, and arguably smaller, ask than including an out of tree DKMS driver. And yes, the driver also needs the firmware to be effective.