PVE 局域网唤醒支持
第一步:
是要把bios里面远程唤醒功能和PCI启动打开
第二步:
在PVE里面的SHELL或者SSH安装 ethtool 工具,安装命令:
apt-get install ethtool
第三步:
用ethtool工具查看网卡信息,如果是多网卡的话,需要先搞清楚哪个是链接外网的管理口,举例网卡为enp3s0
ethtool enp3s0
找到网卡信息中的supports wake-on和wake-on两个参数,如果supports值为pumbg,表示网卡支持远程唤醒,wake-on的值d表示禁用、g表示开启,默认为d。
第四步:用ethtool开启网卡远程唤醒,把wake-on值改为g
ethtool -s enp3s0 wol g
因为每次重启后会失效,所以我们需要把开启命令写入开机自动执行脚本。
第五步:
编辑 /etc/rc.local文件,写入开机自动执行开启远程唤醒的脚本。
nano /etc/rc.local
插入以下代码后保存重启all done
#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. /sbin/ethtool -s enp3s0 wol g exit 0
比较新的Linux发行版已经没有rc.local文件了。因为已经将其服务化了。
解决方法:
1、设置rc-local.service
1
2
3
4
5
6
7
8
9
10
11
12
13
|
sudo vim /etc/systemd/system/rc-local.service [Unit] Description=/etc/rc.local Compatibility ConditionPathExists=/etc/rc.local [Service] Type=forking ExecStart=/etc/rc.local start TimeoutSec=0 StandardOutput=tty RemainAfterExit=yes SysVStartPriority=99 [Install] WantedBy=multi-user.target |
2、激活rc-local.service
1
|
sudo systemctl enable rc-local.service |
3、添加启动服务
手工创建或者拷贝已有的/etc/rc.local
,并赋予执行权限
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. # 下面这条是要开机启动的命令 /home/selfcs/anaconda3/bin/python /home/selfcs/t.py > /home/selfcs/auto.log exit 0 #给予脚本执行权限 sudo chmod +x /etc/rc.local |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~