1. Go to your BIOS, and turn on WakeOnLAN (it varies, look for it or one with similar name). If your network card is onboard, go to step 2b, otherwise, go to step 2a first.
2. Back in Ubuntu, Kubuntu, Xubuntu, we now need to write a script that will run every time the computer is on, because this command only lasts until the computer is turned on once again.
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 desktop that is only connected via wireless with Wake-on-LAN, unless the BIOS has a method for this, this is rarely the case, and I do not guarantee this will work in such cases.
In your terminal, type:
1 | ifconfig |
1 2 3 4 5 6 7 8 9 | 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 |
1 2 3 4 5 6 7 8 | 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.
Take note that you must be an administrator of the system you are doing this to.
1 | sudo -i |
1 2 | cd /etc/init .d/ pico wakeonlanconfig |
1 2 3 | #!/bin/bash ethtool -s eth0 wol g exit |
1 | chmod a+x wakeonlanconfig |
1 | update-rc.d -f wakeonlanconfig defaults |
1 2 3 4 5 6 7 8 | 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 |
1 | /etc/init .d /wakeonlanconfig |
3. Use it. you’ll need something to send Wake-on-LAN packets with, “wakeonlan” is in the repositories. 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:
1 | ifconfig | grep HW |
turn off that system:
1 | sudo halt |
1 | wakeonlan 01:23:45:67:89:ab |
If that doesn’t work, its likely the port on the system your trying to wake up isn’t the default (9), try 7, or if your BIOS settings or book told you one, use that one.
1 | wakeonlan -p 7 01:23:45:67:89:ab |
Thanks to:
http://www.blog.highub.com/php/php-core/set-ubuntu-up-for-wake-on-lan/
No comments:
Post a Comment