简介
个人使用的是自组NAS物理机安装了飞牛,原本连接家中万兆路由可以正常协商万兆,后面更换路由器2.5G网口发现加装的X550-T2万兆电口卡只能协商到1G速率,在论坛反馈后加入了需求池但截至0.9.24版本仍未修复。所以自己改了一下脚本,支持systemd服务,更适合飞牛,使用设备名和PCI ID进行匹配网卡,增强泛用性
适用范围
- 硬件:Intel X550 网卡(常见 PCI ID:
8086:1563
)
- 目标:飞牛开机时自动执行
ethtool -s <iface> advertise <HEX>
上传与解压
用finalshell或者任何你喜欢的工具将压缩包
附件:set-x550-advertise.zip通过 SSH/SCP 上传到主目录(例如 /home/<user>/
),然后:
cd ~
unzip set-x550-advertise.zip
cd set-x550-advertise
目录内包含:
set-x550-advertise.sh
(脚本)
set-x550-advertise.service
(systemd 服务)
安装脚本与服务
将文件移动到系统标准目录:
sudo mv set-x550-advertise.sh /usr/local/bin
sudo mv set-x550-advertise.service /etc/systemd/system
建议:
sudo chmod 755 /usr/local/bin/set-x550-advertise.sh
sudo chmod 644 /etc/systemd/system/set-x550-advertise.service
启用与启动
sudo systemctl daemon-reload
sudo systemctl enable set-x550-advertise.service
sudo systemctl start set-x550-advertise.service
查看状态(判定成功)
systemctl status set-x550-advertise.service
看到如下关键行即为成功:
Active: active (exited)
之后每次开机都会自动设置网卡。
卸载/回滚
sudo systemctl disable --now set-x550-advertise.service
sudo rm -f /etc/systemd/system/set-x550-advertise.service
sudo rm -f /usr/local/bin/set-x550-advertise.sh
sudo systemctl daemon-reload
结束
请确保 systemctl status set-x550-advertise.service
显示 Active: active (exited)
,飞牛查看网口速率为2.5G/5G即可确认已生效,后续开机将自动设置网卡。