Realtek RTL 8125 2.5Gbps LAN controller.

JMOR

Member

Reaction score: 1
Messages: 20

Let me apologize upfront if this is too much of a basic question. Sure there are enough resources out there for me to figure this one out by myself. But, I am complete newbie to BSD Unix, and some guidance may help me to speed up the process.

I am trying to install FreeBSD (13.0) in my new PC but I am missing the very important Ethernet driver, hence no connection to Internet. I have a MSI X570 Unify motherboard which comes with a Realtek RTL 8125 2.5Gbps LAN controller. (Additionally to a Intel Wi-Fi 6 AX200 connection, but I am not even looking at this yet)

I am thinking in copying the driver into the USB installer, some directory in either memstick.img or mini-memstick.img (preferably the later, but it won't have the base system nor way to access the Internet to get it - NIC not recognized). Then proceed with the installation as per the HandBook, afterwards copy the driver I put in the installer into the just installed base system, do some magic, and hopefully after rebooting I would be able to access the network card.

Am I wrong or am I wrong? Anyway, some directions would be appreciated.

By the way, I think this is the driver I should be using: realtek-re-kmod (Kernel driver for Realtek PCIe Ethernet Controllers from FreshPorts). But, it seems I would need to access the port from the PC to get the driver? which would be impossible given that I won't have a functional network connection. Though, I could in any case just download the driver straight up from Realtek's website and put that into the installer image.

Again, some guidance about the proper way to proceed in this case would be appreciate it.

Thanks in advance.

As an aside: I understand that maybe in production systems it is more common to use Intel NICs. But there are quite a few models of motherboards from the big players (MSI, Gigabyte, ASRock, and so on) that come with this Realtek 2.5Gbps NIC. I think FreeBSD would make a BIG favor to not a small number of home users were it to include this driver in the base system.
 

T-Daemon

Daemon

Reaction score: 875
Messages: 1,749

By the way, I think this is the driver I should be using: realtek-re-kmod (Kernel driver for Realtek PCIe Ethernet Controllers from FreshPorts). But, it seems I would need to access the port from the PC to get the driver? which would be impossible given that I won't have a functional network connection. Though, I could in any case just download the driver straight up from Realtek's website and put that into the installer image.
Better download the FreeBSD package than the driver from the manufacturer:

fetch https://pkg.freebsd.org/FreeBSD:13:amd64/quarterly/All/realtek-re-kmod-v196.04_2.txz

After the system is installed drop into a shell of the installer (or reboot into the new system) and extract (tar(1)) the package into the new system, edit /boot/loader.conf, set the necessary variables to load the driver.

Manually extracting the package won't be registered in the systems local package database. To make the database aware of the package reinstall the package with the systems ports(7) / pkg(8) facilities.

There are +COMPACT_MANIFEST and +MANIFEST files leftovers from the package after extracting manually, you might want them removed.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,285
Messages: 38,796

If you're downloading packages in advance might as well download the package for pkg too. Extract it and use the included pkg-static command to install itself. Then use pkg-add(8) to install the downloaded module.
 

T-Daemon

Daemon

Reaction score: 875
Messages: 1,749

If you're downloading packages in advance might as well download the package for pkg too. Extract it and use the included pkg-static command to install itself. Then use pkg-add(8) to install the downloaded module.
Nice!

Assuming downloaded packages are in /tmp :
Code:
tar xf pkg-1.16.3.txz
usr/local/sbin/pkg-static add pkg.1.16.3.txz
pkg add realtek-re-kmod-v196.4_2.txz
rm -r usr +COMPACT_MANIFEST +MANIFEST pkg-1.16.3.txz realtek-re-kmod-v196.4_2.txz
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,285
Messages: 38,796

Fixed the code for you, /usr/local/sbin/pkg-static should be relative from the directory you extracted the .txz in, so it's usr/local/sbin/pkg-static. Then it doesn't matter where you saved or extracted the archive (I usually just do this in /tmp).
 

andmars

New Member


Messages: 2

Hi, I'm in the same boat here. I was able to do a netinstall freebsd on my laptop but not on my main PC, due to the RTL8125B on my ASUS TUF GAMING B550 main board.

So now I'm trying to wrap my head around what I need to do here before the installation. Since netinstall won't work I downloaded and dd the disc1.iso to my usb stick (don't have any optical drives).
That way I can boot up my machine into freebsd and install it.
Then what? Don't understand how to get the files "pkg" and "realtek-re-kmod" (have them downloaded to my current arch linux) over to the newly installed freebsd and into /tmp? Will I need an extra usb drive, mount it and move the files over?
Or is there a way to prepare the install media before installing?
What am I missing here?
 

Vull

Aspiring Daemon

Reaction score: 441
Messages: 733

Hi, I'm in the same boat here. I was able to do a netinstall freebsd on my laptop but not on my main PC, due to the RTL8125B on my ASUS TUF GAMING B550 main board.

So now I'm trying to wrap my head around what I need to do here before the installation. Since netinstall won't work I downloaded and dd the disc1.iso to my usb stick (don't have any optical drives).
That way I can boot up my machine into freebsd and install it.
Then what? Don't understand how to get the files "pkg" and "realtek-re-kmod" (have them downloaded to my current arch linux) over to the newly installed freebsd and into /tmp? Will I need an extra usb drive, mount it and move the files over?
Or is there a way to prepare the install media before installing?
What am I missing here?
I can maybe get you part way there, although I haven't done this either. Since you don't have a working FreeBSD system yet, you will probably need an extra USB drive for the two extra files.

You probably won't be able to use FreeBSD's fetch command either, but you can copy and paste the URL, without the fetch keyword, into your web browser's address widget, and it should offer you a chance to download the file on your Linux drive:

https://pkg.freebsd.org/FreeBSD:13:amd64/quarterly/All/realtek-re-kmod-v196.04_2.txz

I'm unable to determine the exact location of the pkg-1.16.3.txz file, but maybe someone else can help you with that. The version number may have changed, since this thread is already over a couple of months old.

Once you have the two files, you should be able to copy them onto a scratch USB drive which is formatted with vfat32 or whatever, using your Arch Linux system. Then when you run the FreeBSD installer, or after you reboot, you can get to a root shell, find your second USB drive with ls /dev/da*, and mount the drive with something like mount -t msdosfs /dev/da0s1 /mnt. Copy the files into /tmp, then refer back to post #4 above, and take it from there.

Edited to add: I missed the point where you already have FreeBSD on your laptop. Since you already have a FreeBSD box, you can generate pkg-1.16.3.txz yourself using the command pkg create -x pkg which will create the file in your present working directory.
 

T-Daemon

Daemon

Reaction score: 875
Messages: 1,749

I'm unable to determine the exact location of the pkg-1.16.3.txz file,
How so? It's right there :) :


Since you already have a FreeBSD box, you can generate pkg-1.16.3.txz yourself using the command pkg create -x pkg which will create the file in your present working directory.
That would work if ports-mgmt/pkg was installed, but it looks like andmars hasn't it installed. What remains is to install it as described earlier.
 

T-Daemon

Daemon

Reaction score: 875
Messages: 1,749

Or is there a way to prepare the install media before installing?
There are ways to prepare the FreeBSD installer media, but other methods than to use a spare USB drive, as Vull suggested, would take longer to bring the files over to FreeBSD.
 

Vull

Aspiring Daemon

Reaction score: 441
Messages: 733

How so? It's right there :) :



That would work if ports-mgmt/pkg was installed, but it looks like andmars hasn't it installed. What remains is to install it as described earlier.

Ha like the nose on my face I didn't see it. Also, after re-reading his first paragraph, I saw where I overlooked the fact that he has two FreeBSD boxes, one with "netinstall" FreeBSD, and one without, so he should be able to generate pkg-1.16.3.txz on his laptop after running pkg bootstrap or pkg install ... on it.
 

andmars

New Member


Messages: 2

Hi there, it worked just fine. All I had to do afterward, was add

Code:
ifconfig_re0="DHCP"
ifconfig_re0_ipv6="inet6 accept_rtadv"

and I had working internet. In fact I'm writing this on my main PC on FreeBSD 13 right now.

Unfortunately I'm not that happy with it, yet. Lots of tiny things that don't quite work as smootly as in my 12 years with Arch Linux. I will tinker with it during the weekend but I'm affraid I might go back to linux even though I don't like the big corporate influence on it, the systemd stuff, etc. We'll see. Thanks for your help, tough!
 

fundon

New Member


Messages: 6

I use iperf3 to test it. Just It just has 1000MB. The card cant switch to media 2500Base-T mediaopt full-duplex.

ifconfig_re0="inet 192.168.0.30 netmask 255.255.255.0 media 2500Base-T mediaopt full-duplex"

Server listening on 5201 (test #1)
-----------------------------------------------------------
Accepted connection from 192.168.0.13, port 51340
[ 5] local 192.168.0.30 port 5201 connected to 192.168.0.13 port 51341
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 111 MBytes 934 Mbits/sec
[ 5] 1.00-2.00 sec 111 MBytes 935 Mbits/sec
[ 5] 2.00-3.00 sec 111 MBytes 935 Mbits/sec
[ 5] 3.00-4.00 sec 111 MBytes 935 Mbits/sec
[ 5] 4.00-5.00 sec 111 MBytes 935 Mbits/sec
[ 5] 5.00-6.00 sec 111 MBytes 935 Mbits/sec
[ 5] 6.00-7.00 sec 111 MBytes 935 Mbits/sec
[ 5] 7.00-8.00 sec 111 MBytes 935 Mbits/sec
[ 5] 8.00-9.00 sec 111 MBytes 934 Mbits/sec
[ 5] 9.00-10.00 sec 111 MBytes 935 Mbits/sec
[ 5] 10.00-10.00 sec 215 KBytes 940 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate
[ 5] 0.00-10.00 sec 1.09 GBytes 934 Mbits/sec receiver
-----------------------------------------------------------
Server listening on 5201 (test #2)
-----------------------------------------------------------
 
Top