Linux の種類によってコマンド名が違うようです。インストールのapt とか、yum みたいなノリ?
なんかイイですよね。
さて、「Paspberry Pi OS」の場合、wakeonlan が使える様です。
Raspberry Pi OS で使えるWOL コマンド
Contents
インストール
apt install wakeonlan
![](https://zapping.beccou.com/wp-content/uploads/2021/08/image-230-2-edited.jpg)
使い方を確認。
root@beccou-server:/home/uniuni# wakeonlan
Usage
wakeonlan [-h] [-v] [-i IP_address] [-p port] [-f file] [[hardware_address] …]
Options
-h
this information
-v
displays the script version
-i ip_address
set the destination IP address
default: 255.255.255.255 (the limited broadcast address)
-p port
set the destination port
default: 9 (the discard port)
-f file
uses file as a source of hardware addresses
See also
wakeonlan(1)
とりあえず、wakeonlan の後にハードウェアアドレスを入れれば良さそうです。
テスト
ブロードキャスト宛に送信したメッセージ。
![](https://zapping.beccou.com/wp-content/uploads/2021/08/image-230-3-edited.jpg)
![](https://zapping.beccou.com/wp-content/uploads/2022/04/image-295.png)
起きてこない。。。
![](https://zapping.beccou.com/wp-content/uploads/2021/08/image-230-3-edited-1.jpg)
マジックパケットが送信されているか確認。
ブロードキャストなんで、他の端末でワイヤーシャークで確認できるはず。
![](https://zapping.beccou.com/wp-content/uploads/2021/06/image-230-4-1024x692.jpg)
さらにフィルタを設定したので、これでラズパイからの通信だけ確認できる。はず。
![](https://zapping.beccou.com/wp-content/uploads/2021/08/image-230-5-edited.jpg)
Ping を送ってテスト。
![](https://zapping.beccou.com/wp-content/uploads/2021/08/image-230-6-edited.jpg)
![](https://zapping.beccou.com/wp-content/uploads/2022/04/image-295.png)
Ping げと。
![](https://zapping.beccou.com/wp-content/uploads/2021/08/image-230-7-edited.jpg)
「-i」でキャプチャしている端末のIP を指定し、直接WOL を送信してみる。
![](https://zapping.beccou.com/wp-content/uploads/2022/04/image-295.png)
受け取った。
WOL というプロトコルで表示されています。
![](https://zapping.beccou.com/wp-content/uploads/2021/08/image-230-12-edited.jpg)
「-i」で192.168.3.255 を指定したブロードキャスト で送信してみる。
![](https://zapping.beccou.com/wp-content/uploads/2022/04/image-295.png)
受け取った!
![](https://zapping.beccou.com/wp-content/uploads/2021/08/image-230-13-edited-1.jpg)
ターゲットが起きた!
![](https://zapping.beccou.com/wp-content/uploads/2021/08/image-230-15-edited.jpg)
まとめ
ブロードキャストのデフォルトは「255.255.255.255」。
場合によって、ブロードキャストアドレスの指定が必要。
(Visited 1,976 times, 1 visits today)
ピンバック: スリープモード中のPC へ リモートデスクトップ接続する - .zapping