LoginSignup
19
23

More than 5 years have passed since last update.

Raspberry PiからWOL(Wake On Lan)

Posted at

Raspberry PiからLAN内PCへのWOL(Wake On Lan)を可能にします。

今回は下記のツールを使用させていただきます。

1.Raspberry Piにログインし、ツール(Cファイル)を取得

$ wget http://www.gcd.org/sengoku/docs/wol.c

2.Cファイルをコンパイルし、実行ファイルを作成

$ gcc wol.c -o wol

3.起動したいPCのIPアドレスとMACアドレスを指定して実行
※IPアドレスはブロードキャストアドレス(192.168.1.255等)でも構いません

wol 192.168.1.2 xx:xx:xx:xx:xx:xx

これでRaspberry PiからWOL可能になりました。

外から自宅内のRaspberry Piに接続して、WOLを実行すれば自宅内のPCを起動できます。
私はAndroidからRaspberry PiにSSH接続して、Raspberry PiからWOLを実行して、Windows端末を起動しています。

シェル等を作成した方が楽です。

#!/bin/bash

wol 192.168.1.2 xx:xx:xx:xx:xx:xx

以上!

19
23
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
23