ethtool -s eth0 wol g
-------------------------------------------------------------------------------------------------------
So, here it goes. First off, make sure your system supports WakeOnLAN (WOL), if you know your system well, you already know if it does or doesn't.
--
Automatic way:
This script does everything described in the Manual way, for you, except step 1 and step 4.
------------------------
The automatic method is super dialup friendly! thanks to gzip compression the filesize is a mere 1.5kb! almost half the extracted size of 3.4kb!
1. If you havent already, go to your BIOS, and turn on WakeOnLAN (it varies, look for it.) If your network card is onboard, your set for step 2, otherwise there is probably a cable that should go from your network card to your motherboard, though this is not always the case.
Before continuing, note the interface you want to do this to. Most people know how to do this, if you do not, look at step 2a of the manual method.
2. Download and extract this: You can do it with the GUI and run the extracted program in a terminal by double clicking it, or open a terminal and do the following:
**** Removed dead link ****
3. As the exit of the program notes, now you just need to get/use a wake on lan sending program, like wakeonlan.
4. Sit on your lazy *** and have fun
--
Manual way:
------------------------
1. If you havent already, go to your BIOS, and turn on WakeOnLAN (it varies, look for it.) If your network card is onboard, your set for step 2, otherwise there is probably a cable that should go from your network card to your motherboard, though this is not always the case.
2. Back in ubuntu, kubuntu, xubuntu, w/e, we now need to make a script that will run every time the computer is started, because this command only lasts until the computer is turned on again once.
2a. Find out what network device you want to have the computer wake-able from, usually all, which is just one. If you have more network devices in your system, 9 chances out of 10, you already know what they are called.
You can NOT wake up a laptop or computer that is only connected via wireless with wake-on-lan, unless the bios has a method for this, this is very rare, and I do not garuntee this howto will work in such cases.
In your terminal, type:
ifconfig
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)
2b. Now we create the script.
Note: you must be an administrator on the system you are doing this to.
sudo -i
Change to the startup script directory and start editing a new file:
cd /etc/init.d/ pico wakeonlanconfig
#!/bin/bash ethtool -s eth0 wol g exit
chmod a+x wakeonlanconfig
update-rc.d -f wakeonlanconfig defaults
Adding system startup for /etc/init.d/wakeonlanconfig ... /etc/rc0.d/K20wakeonlanconfig -> ../init.d/wakeonlanconfig /etc/rc1.d/K20wakeonlanconfig -> ../init.d/wakeonlanconfig /etc/rc6.d/K20wakeonlanconfig -> ../init.d/wakeonlanconfig /etc/rc2.d/S20wakeonlanconfig -> ../init.d/wakeonlanconfig /etc/rc3.d/S20wakeonlanconfig -> ../init.d/wakeonlanconfig /etc/rc4.d/S20wakeonlanconfig -> ../init.d/wakeonlanconfig /etc/rc5.d/S20wakeonlanconfig -> ../init.d/wakeonlanconfig
/etc/init.d/wakeonlanconfig
3. Use it. you'll need something to send wake-on-lan packets with, "wakeonlan" is in the repos. And you'll need the mac address of the system.
To get your MAC address, on the same system you just enabled WOL on, type:
ifconfig | grep HW
turn off that system:
sudo halt
wakeonlan 01:23:45:67:89:ab
If that doesnt work, its likely the port on the system your trying to wake up isnt the default (9), try 7, or if your BIOS settings or book told you one, use that one.
wakeonlan -p 7 01:23:45:67:89:ab
*Note: It has been said that you need to disable -i from halt, however I have never had to do this, nor do I know how.
4. Sit on your lazy *** and have fun
Feel free to post any questions, suggestions, problems and I will tend to them ASAP.
Added notes:
* For this to work, most systems must be shut down properly, ie: with the power button or halt, or any of the ways to shut down. Unclean power-offs (like a power outage or holding the power button for 5s) seem to stop WOL from working untill the system is powered on and shut down properly. Though, there my be a few exceptions. This is a hardware issue with the BIOS. In my opinion, WOL should work regardless of how the system is powered off, but thats not the case. I suggest, if you have frequent power outages, that you have your BIOS set to Power ON after a power failure, most new systems allow this.
'보안 > 서버관리' 카테고리의 다른 글
ubuntu_server에서 할글 깨짐 현상 해결 (0) | 2011.12.19 |
---|---|
DB, MySQL 계정 생성 (0) | 2011.12.19 |
apache2 디렉토리 인덱싱 안되게 하기 (0) | 2011.12.16 |
개인도메인만들기/네임서버설정 (0) | 2011.12.16 |
우분투 복구 모드 사용하기 (0) | 2011.12.05 |