Solved realtek-re-kmod not included; no network

I am encountering issues installing FreeBSD 14.3 on bare metal due to the lack of preinstalled drivers for Realtek Ethernet port drivers. The issue is incredibly frustrating to deal with because the system is in a barely usable state.

Steps to reproduce:
  • Motherboard with Realtek RTL8125 Ethernet
  • FreeBSD 14.3 DVD flash drive for offline installation
  • System without network connectivity
I tried to solve the problem by fetching the driver package using a different device and copying it to the FreeBSD system using a drive. I quickly realized how the ".pkg" file would be unusable, since FreeBSD 14.3 does not come with pkg preinstalled. Upon reading documentation, I found out that there is an installation file located in `/usr/sbin/pkg`. While it provides a way to install pkg, it requires network connectivity.

Gist of commands:

separate device
# pkg fetch realtek-re-kmod
# cp /var/cache/pkg/realtek-re-kmod-1100.00.1403000_1.pkg /dev/sda
pkg fetch realtek-re-kmod
cp /var/cache/pkg/realtek-re-kmod-1100.00.1403000_1.pkg /dev/sda
on device
mount /dev/sda /home/folder
cd /home/folder
pkg add realtek-re-kmod-1100.00.1403000_1.pkg # error becuase pkg not installed

I have also tried bringing the driver source code straight from git onto my system but I am not familiar with how a manual installation is supposed to be done.

Gist of commands:

separate device
...bring to offline system
./Makefile # encounter errors I don't understand

To summarize;

I am stuck with a chicken-and-egg problem with no clear solution. In theory, I imagine that this shouldn't be impossible to solve; I just need to get either the driver or pkg manually onto my system somehow, which is why I am reaching out in forum. Apologies if this isn't formatted to standards, I am tired after troubleshooting.
 
Or, plug in a mobile phone (with a mobile data plan), enable USB tethering, run dhclient ue0, pkg bootstrap pkg, install realtek driver.

Edit: I just remembered, that you can also access your phone's Wi-Fi via its USB tethering function to connect to a Wi-Fi hotspot.
 
Chicken, egg. Who wants to go first?

The basic problem is the driver for your hardware is not included in stock/generic kernels.
Which means (as you've stated) no network, no way to update.

A possible solution is a USB to ethernet dongle; that would let you pkg install the re kmod.
But you'd need to make sure that the dongle is supported.

This is not unique to FreeBSD; Linux did not have support until kernel 5.15 or so. Before then you'd need to download the driver on a USB device, copy to the target system, and build for your running kernel.
 
Or, plug in a mobile phone (with a mobile data plan), enable USB tethering, run dhclient ue0, pkg bootstrap pkg, install realtek driver.

Edit: I just remembered, that you can also access your phone's Wi-Fi via its USB tethering function to connect to a Wi-Fi hotspot.
On device
Code:
mount /dev/sda /home/folder
cd /home/holder
tar xzf realtek-re-kmod-1100.00.1403000_1.pkg /boot/modules/if_re.ko
mv boot/modules/if_re.ko /boot/modules
then add the following lines to /boot/loader.conf and reboot.
Code:
if_re_load="YES"
if_re_name="/boot/modules/if_re.ko"
This is a great suggestion. I did not think of simply using an adapter. I was able to resolve all issues shortly after.

Thank you for all of your replies. At the time I made the post I was tired and frustrated but now that the solution ended up being so simple I am happy I encountered it for the learning experience. This has been a very fun first issue and I am happy to be using FreeBSD on my server now.
 
Back
Top