[ubuntu]wake on lan設定

參考網址:https://www.itread01.com/content/1547482884.html

登入需要遠端喚醒開機的目標機器,執行ethtool命令檢視網絡卡是否支援Wake On Lan

[root@localhost]# ethtool eth0

看這兩行

Supports Wake-on: pumbg

Wake-on: d

若Wake-on為d,表示禁用Wake On LAN,需要啟用它。

 

[root@localhost]# ethtool -s eth0 wol g

如果已經是g就說明目標機器的網絡卡已經支援Wake On LAN。

 

https://www.itread01.com/content/1550410051.html

當機器重啟後,eth0的設定又會回覆到Wake-on: d 狀態,
這個問題怎麼解決?
兩個辦法:第一個,也是我們的慣性思維;
把/sbin/ethtool -s eth0 wol g 這條命令附加到/etc/rc.local這個檔案中,
則下次開機後會自動執行

第二個: 編輯/etc/sysconfig/network-scripts/ifcfg-eth0
(eth0網絡卡的配置檔案),新增上一行:
ETHTOOL_OPTS=”wol g”

lubuntu 22.04的相關檔案放在/etc/NetworkManager/system-connections
但內容似乎不太一樣
試著在圖形界面修改,在網路連線修改界面中的ethernet頁籤中有個wake-on-lan的選項,
勾選magic後,在該連線檔中
[ethernet]
mac-address-blacklist=
wake-on-lan=64  <<多了這一行

重新開機後查詢網卡狀態,已可以wake-on-lan了

 

TG-3468網卡設定
https://www.tp-link.com/tw/support/download/tg-3468/
 如何消除 TG-3468 的等待畫面 https://www.tp-link.com/tw/support/faq/331/
當電腦一開始啟動並顯示一些基本資訊時,按下 [Shift+F10] ,然後會出現 TG-3468 網路卡的設定功能表

 

小麥部落 linux 使用 wake on lan

https://wiki.debian.org/WakeOnLan#Hardware

 

systemctl  https://necromuralist.github.io/posts/enabling-wake-on-lan/

which ethtool
In my case the path was /sbin/ethtool, so once you know this you can create a file at /etc/systemd/system/wol.service (I think you can use another systemd sub-folder, and you can name the file anything you want, within reason, but this one seems to work well enough). In this file you put settings that look something like this:

[Unit]
Description=Enable Wake On Lan

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

[Install]
WantedBy=basic.target
The only thing specific to my machine is enp4s0, the name of the ethernet interface, although it's possible that the path to the ethtool executable might be different too… but it should be the same on Ubuntu 20.10, anyway.

Enable The Service
To enable it you can do this:

sudo systemctl daemon-reload
sudo systemctl enable wol.service
Where wol.service is the name of the file you created with the settings. You can check its status if you want.

systemctl status wol

 

本篇發表於 Linux系統。將永久鏈結加入書籤。