Ubuntu 24.04网卡是Realtek RTL8125 (2.5G)驱动安装
Ubuntu 24.04 Server*,网卡是 **Realtek RTL8125 (2.5G)**,系统安装后网卡无法驱动起来。
👉 内核驱动问题:
- RTL8125 需要
r8125驱动,而 Ubuntu 24.04 自带的内核默认用r8169(兼容驱动),结果识别不到或者不稳定。
经过实验在hwe内核在,网络可以正常不过无法正常安装完毕系统,最后切换到ubuntu22.04在人工编译安装驱动才解决问题。
解决思路
1. 确认网卡情况
1 | lspci -nnk | grep -A3 -i ethernet |
看是不是:
Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller [10ec:8125]
并且 kernel driver in use 可能是 r8169 或者没有。
2. 临时方案:用 r8169
如果 r8169 能勉强驱动,你可能能看到接口,但可能速率不稳定。
1 | lsmod | grep r8169 |
如果有,那至少说明系统加载了驱动,但可能没启起来。
3. 正式方案:安装 Realtek 官方驱动 r8125
- 准备编译环境
1 | sudo apt update |
- 下载驱动源码
Realtek 官网有,但麻烦。更简单的是用 GitHub 的 DKMS 包:
- https://github.com/awesometic/realtek-r8125-dkms.git
- https://www.realtek.com/Download/List?cate_id=584
- https://github.com/mvpbang/r8125
1 | git clone https://github.com/awesometic/realtek-r8125-dkms.git |
- 确认驱动加载
1 | lsmod | grep r8125 |
- 重启网络
1 | sudo modprobe r8125 |
此时应该能看到 enpXsY 这样的新网卡。
4. 防止内核更新后失效
因为你用 DKMS,它会在以后内核升级时自动重新编译。
美滋滋,ubuntu相对其他系统内核升级较频繁,好玩意dkms。
⚡ 总结
- Ubuntu 24.04 自带的
r8169驱动对 RTL8125 支持很差 - 你需要手工装 r8125 DKMS 驱动
- 装完后就能识别网卡,之后用
netplan配置网络