界面上选择系统设置 - 命令行

先查看网卡名称:

root@truenas[~]# ifconfig

trueNas3 可以看到我这边lan口是第一个eno1,我们记住这个名字

然后执行如下命令

root@truenas[~]# ethtool -s eno1 wol g

执行完毕之后再查看一下状态是否生效:

root@truenas[~]# ethtool eno1 | grep Wake-on

trueNas4 如上设置即可

上面的WOL设置是临时生效,重启即失效

永久生效需要执行如下命令:

  1. 创建服务 eno1 -- 注意需要替换成自己的网卡名称。
[Unit]
Description=Enable Wake On Lan

[Service]
Type=oneshot
ExecStart = /usr/sbin/ethtool --change eno1 wol g

[Install]
WantedBy=basic.target
  1. 设为开机启动
systemctl daemon-reload
systemctl enable wol.service
  1. 尝试重启查看
systemctl status wol

ethtool eno1 | grep Wake-on

教程转载自https://pipboy.cn/code/server/linux/wol.html

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用 Akismet 来减少垃圾评论。了解我们如何处理您的评论数据