Solved Realtek RTL8125 on-board not discovered

So...I want to install FreeBSD on my shop computer. I use a USB flash drive to install FreeBSD 13.2-RELEASE and everything goes forward just fine.....except....that it doesn't find my on-board NIC, so I have no network.

I realize that the Realtek NICs sometimes have difficulty with FreeBSD....or vice versa...but doing pciconf -lv | grep -A1 -B3 network results in finding that the on-board NIC is a Realtek RTL8125.

I would have thought that the FreeBSD install would have found it as re0, but it didn't.

Why and how do I fix this?

I have ordered a new Intel PCIe gigabit NIC, but it won't be here until after Christmas.

Is there any fairly easy way to get the system to recognize and use the Realtek NIC in the meantime?

I have visited the Handbook, but so far it hasn't addressed this sort of issue.

Ken Gordon
 
Yes. I tried to install that. I, as root, went to /usr/ports/net/realtek-re-kmod and did make install clean. The process started but ended with errors without the driver being installed.

With no network at all, it couldn't complete.

I could try it without clean, but I suspect it will still stop with errors

It is looking like I will have to wait for my new Intel card to get here before I can continue with my build.

Thanks,

Ken Gordon
 
Try get pkg on another machine then install it.
fetch https://pkg.freebsd.org/FreeBSD:13:amd64/latest/All/realtek-re-kmod-198.00_3.pkg
pkg add realtek-re-kmod-198.00_3.pkg
 
I, as root, went to /usr/ports/net/realtek-re-kmod and did make install clean. The process started but ended with errors without the driver being installed.
How is the ports system supposed to download the distfile if the system doesn't have a working network card? You have a bit of a chicken and egg problem here.
 
OK. I downloaded both the realtek* pkg and both pkg.pkg and pkg.txz, then copied them to a USB drive.

I THINK I can get these two installed by first doing pkg add pkg.pkg or perhaps pkg add pkg.txz

If that doesn't work, I'll figure something else out......or maybe I'll have to wait for my new Intel card to get here.

Anyway, this has certainly been an interesting "learning experience", and it has been kinda fun. Now I know how to use USB drives on FreeBSD.

Ken Gordon
 
fetch https://pkg.freebsd.org/FreeBSD:13:amd64/latest/All/realtek-re-kmod-198.00_3.pkg
tar xzf realtek-re-kmod-198.00_3.pkg /boot/modules/if_re.ko
Move boot/modules/if_re.ko to /boot/modules on the target machine, then add the following lines to /boot/loader.conf and reboot.
Code:
if_re_load="YES"
if_re_name="/boot/modules/if_re.ko"
 
#9 does not use pkg.

fetch https://pkg.freebsd.org/FreeBSD:13:amd64/latest/All/pkg-1.20.9.pkg
and on the target machine
/usr/sbin/pkg add pkg-1.20.9.pkg
Edit:I have not tried.
 
No. I don't. What you write, Charlie, worked perfectly.

Now all I have to do is to set it up for DHCP.

Thanks a bunch!!

Ken Gordon
 
If you used the method from message #9 to install the driver, don't forget to do pkg install realtek-re-kmod to install the realtek driver "properly" and register it to your local package database; then you'll be able to get future updates of the driver via pkg-upgrade(8)
 
If you used the method from message #9 to install the driver, don't forget to do pkg install realtek-re-kmod to install the realtek driver "properly" and register it to your local package database; then you'll be able to get future updates of the driver via pkg-upgrade(8)
Will do. I have other issues that have popped up which I must handle first, but I will do that.

And, again, thanks.

Ken Gordon
 
I tried the same method with 14.1 point release and it worked fine. Today I updated to the CURRENT branch and the if_re driver does not work. ifconfig -a shows nothing except the loop device ...
 
I tried the same method with 14.1 point release and it worked fine. Today I updated to the CURRENT branch and the if_re driver does not work. ifconfig -a shows nothing except the loop device ...
You have to rebuild or reinstall all packages. CURRENT uses a never libc (among other things) than 14.1. You can use a mobilephone as temporary connection. look here https://forums.freebsd.org/threads/tethering.80705/ or search yourself.
 
The same problem exist for FreeBSD 14.2-RELEASE on Asus Prime board with Realtek RTL8125. Is there really no work-around with dynamic kernel modules? It looks like some other driver is blocking the Realtek driver.

# kldload if_re
module_register: cannot register pci/re from if_re.ko; already loaded from kernel
 
Thanks.

In all night company of some brilliant great users on Discord, I discovered the follwing info and work-around for this Realtek driver kernel naming conflict issue.

RTL8125 is supported by a non-default Realtek driver, that is not adopted into the main driver, because of differences in coding standards. The driver is in ports as "realtek-re-kmod". If the host does not have a connection to Internet, then this port has to be fetched on another host and then transferred via USB storage or alternative medium.

# fetch http://pkg.freebsd.org/FreeBSD:14:amd64/release_2/All/realtek-re-kmod-1100.00_1.pkg

The driver can be extracted and manually placed in the directory for boot kernel modules. The package can not be installed, because the host would still need Internet for that, because of package management.

Code:
# tar zxf realtek-re-kmod1100.00_1.pkg /boot/modules/if_re.ko
# mv boot/modules/if_re.ko /boot/modules/

The driver needs to load during boot, while it is key to succes, that the "name" paramenter is set to the new driver. If this is omitted, then it will not work.

# vi /boot/loader.conf
if_re_load="YES"
if_re_name="/boot/modules/if_re.ko"

I wrote a quick quide with the complete procedure, including quick creation of MSDOS file system on USB for the task.

https://www.micski.dk/2024/12/06/realtek-rtl8125-network-interface-driver-for-freebsd/
 
Back
Top