Fix for Realtek RTL8125 Not Getting IP Address on Ubuntu 24.04+
I ran into a frustrating issue where my Realtek RTL8125 2.5GbE interface wouldn’t work under Ubuntu 24.04. After lots of trial and error (and help from others and even ChatGPT), I found a method that finally worked. I’m sharing here in hopes it saves someone else the same pain. I’m sorry this writing is kinda rough, but I have to post it before it loses its usefulness to others.
Fix Guide for Realtek RTL8125 (r8125) on Ubuntu 24.04+
This guide helps resolve issues where the onboard 2.5GbE Realtek RTL8125 network interface is present but fails to get an IP address via DHCP or cannot connect to the network.
Tested and confirmed on: Ubuntu 24.04 Noble Numbat, kernel 6.11.0-21-generic.
Critical Prerequisite: Remove Any DKMS Version
If you’ve previously installed a version of the driver via a package like r8125-dkms
(often recommended on forums or from PPAs), you must remove it first, or the manually installed Realtek driver will not take effect.
Run this command to fully remove it:
sudo apt purge r8125-dkms
Then reboot:
sudo reboot
Step-by-Step Fix
Note: I think this original “fix” method requires that Secure Boot be turned off/disabled, else Ubuntu will not load the “foreign”/unsigned driver. Others have mentioned in this Topic a more sophisticated method, including signing the new driver before attempting to boot with it. Failing to do at least one of these might cause your system to boot with no Ethernet and I don’t know if it would tell you why. Please see the posts below.
- Download the official driver from Realtek:
- I went to https://www.realtek.com/ then I had to poke around a bit under the left-nav entry “Downloads” because they keep moving stuff, but I found this link: PCI GBE name: Realtek PCI GBE Ethernet Family Controller Software
- Find the latest version of the RTL8125 Linux driver, e.g. version 9.015.00
- Extract and install:
cd ~/Downloads
unzip r8125-9.015.00.zip
cd r8125-9.015.00
sudo ./autorun.sh
Ignore any warnings about System.map
or BTF
unless they stop the install.
- Reboot the system:
sudo reboot
- Check that the driver version loaded is correct:
sudo ethtool -i enp1s0
Look for this line:
driver: r8125
version: 9.014.01-NAPI # Or later, depending on Realtek release
Note: Despite the Realtek site listing version 9.015.00, the compiled driver may report as 9.014.01. This appears to be normal in Realtek’s source packaging.
To confirm which file is being used:
sudo modinfo r8125 | grep -i filename
It should show:
filename: /lib/modules/$(uname -r)/kernel/drivers/net/ethernet/realtek/r8125.ko.zst
and/or
filename: /lib/modules/$(uname -r)/kernel/drivers/net/ethernet/realtek/r8125.ko
If all is well, your Ethernet port should now work normally, and DHCP should succeed.
If It Still Doesn’t Work
Make sure:
- Your switch/router port and Ethernet cable are known to work
carrier
is1
:
cat /sys/class/net/enp1s0/carrier
- The interface is up:
sudo ip link set enp1s0 up
- Try DHCP again manually:
sudo dhclient -v enp1s0
If that still fails, try assigning a static IP for testing:
sudo ip addr add 192.168.1.155/24 dev enp1s0
ping -c 4 192.168.1.1
If you now get responses, it confirms the driver is working.
Important Note About Kernel Upgrades
If you update your kernel (via apt full-upgrade, or as part of a system upgrade), this fix may stop working. That’s because the compiled driver is not persistent across kernels.
To restore functionality, re-run the install script:
cd ~/Downloads/r8125-9.015.00
sudo ./autorun.sh
sudo reboot
Alternatively, a DKMS-based version of this driver could make the fix persistent, but I don’t know (yet) how to do that (contributions are always welcome).
Notes
- If you’re passing along parts of this guide, I think it’s important to say
r8125-dkms
must be purged first or the system will continue to load the old DKMS driver, even if you’ve compiled/installed a newer one. - Realtek driver version numbers in their archives, and what shows via
ethtool
, may differ slightly — don’t worry if it says9.014.01-NAPI
. - Thanks very much to so many who posted parts of this solution, in several Topics in this forum and elsewhere; I believe asking the right questions and sharing information is a very important part of getting a solution.
Jim