Perform the following on the PC you wish to wake:
- turn on Wake on Lan, or WOL, in the PC's BIOS. How to do this will vary widely depending on your PC so you will need to research this one yourself
- Get the device id of the Ethernet adapter on which you wish to enable Wake on LAN.
Open a Terminal' and type ifconfig. The device id will appear next to a block of text that mentions Ethernet. in the response below eth0 is the Ethernet adapter
eth0 Link encap:Ethernet HWaddr 01:23:45:67:89:ab inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::215:f2ff:fe6f:3487/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:71495 errors:0 dropped:0 overruns:0 frame:0 TX packets:76190 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:23164212 (22.0 MiB) TX bytes:7625016 (7.2 MiB) Interrupt:217 Base address:0xd400 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:1290 errors:0 dropped:0 overruns:0 frame:0 TX packets:1290 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:161182 (157.4 KiB) TX bytes:161182 (157.4 KiB)
- Create a file under /etc/init.d/. This file is going to hook into your PC's boot processes and enable WOL each time your PC is booted. You may give this file whatever name you like.
- Inside the file add the code below. Insert the ID of your Ethernet adapter in place of {adapter Id}.
#!/bin/bash
ethtool -s {adapter id} wol g
exit
- Set appropriate permissions on your script file with the command below. Change {script file} to the name of the script file you created above.
sudo chmod a+x {script file}
- Ensure the script runs at start up with the following command
update-rc.d -f {script file} defaults
Perform the following on the Wakee
To wake the pc you enabled WOL on above, follow the steps below:
- Get the mac address of the PC you wish to wake with the following command. (obviously you will need to do this on the target PC):
ifconfig | grep HW
- Wake the target PC with the following command:
wakeonlan {mac address of the pc you are waking}
No comments:
Post a Comment