The sed command is used here to remove colons (:) from the MAC and to add the x hex specificator (so that 11 becomes x11, 22 becomes x22. And so on) prior to sending the string to the network stack. The forged wake on LAN package is sent to the network stack piping it to NetCat. SoCat can be used instead (syntax will differ, of course). Wake On Lan Command Line is a handy and easy to use application designed to help you wake up computers remotely. In order to use it, you have to enter the following command.
From DD-WRT Wiki
Jump to: navigation, search
English • Deutsch • Español • Français • Italiano • 日本語 • Polski • Português • Русский • Svenska • 中文(中国大陆) • 中文(台灣) • |
|
[edit]Introduction
Wake-On-LAN (WOL) provides the ability to wake a slept/suspended, hibernating, or shut down computer, but the support for this (especially the latter) is dependent upon the hardware and BIOS/UEFI settings. Most modern computers have the WOL feature - it might be listed under PME (Power Management Events).
Reasons to use WOL with DD-WRT:
- You do not want a computer on all the time, yet you want to use it from outside your home or office, and there is a DD-WRT-enabled device as the Internet gateway for that computer, powered on all the time.
- The computer is a media server that auto-sleeps, but you want it to wake automatically for file access.
[edit]Preparation
You will need:
- A PC which supports WOL. Most modern PC's can be set-up this way.
- Administrative access to the computer you want to sleep/wake-up.
- The WOL computer should have a static IP address, one manually assigned or through static DHCP. In the example below, we assume your router LAN is 192.168.1.x (the default) and the static IP WOL computer is 192.168.1.254.
- Ideally, a second PC to test the WOL abilities of the first one. You can also use the DD-WRT device's Web Interface to send test packets, in place of a second PC.
[edit]Enable WOL on the Computer
- On the LAN adapter of the computer (physical ethernet adapter and/or wireless, given BIOS support), choose Properties/Configure.
- Power Management tab (far right). Check the second and third boxes to enable WOL. Press OK until you are back at Network Connections. Now the computer can normally be started from Hibernate, Standby, or PowerOff modes via a special management packet.
- Get ready to test your set-up by using a utility like WOL Magic Packet Sender http://magicpacket.free.fr/ (free). Install it on both the computer you are using and a second PC on the same physical LAN.
- On the WOL computer, open WOL Magic Packet and on the Receive tab, click the green Start button.
- On the second computer, open WOL Magic Packet and on the Send tab, put in:
- IP Address of WOL computer for Host Name
- 0.0.0.0 for Subnet Mask (select from drop-down)
- MAC address of LAN adapter on WOL computer. Use the command 'ipconfig /all' if you don't know what this is.
- Click the green Send button. The WOL computer should respond with a pop-up box showing a packet was received.
Repeat the previous steps and go over the trouble-shooting tips until they work before proceeding.
[edit]Test that WOL works within the LAN
Hibernate, Standby, and Power-off the WOL computer, while clicking Send on the second computer, to test each mode to make sure WOL is working.
Once this step is working, you can go on to making WOL work when you are outside your LAN, such as at a cafe or another remote location.
[edit]Troubleshooting
Wake On LAN is usually disabled by default in most PCs. This feature, if optional, must be enabled in your BIOS otherwise WOL isn't going to work. Consult your motherboard's manual and BIOS screen (DEL at startup, usually). If you don't see the WakeOn-type options in your BIOS, usually somewhere in Power Management, your motherboard may not support WOL.
- A good place to start is here: [1]
[edit]WOL Methods
[edit]WOL through Telnet/SSH
Note: This is the preferred method to send WOL magic packets remotely.
If you have local or remote Telnet/SSH access to your router, you can wake up a machine on the LAN by using the following command:
Note that the full path to '/usr/sbin/wol' is important. Simply 'wol' will not work.
![Cmd Cmd](https://www.easytutoriel.com/wp-content/uploads/2012/11/6.png)
Substitute AA:BB:CC:DD:EE:FF with the actual MAC address of the computer which you wish to boot remotely. Likewise, replace 192.168.1.255 with the actual broadcast address of the network (192.168.1.255 is the broadcast address when the machine has an IP of 192.168.1.x and subnet mask of 255.255.255.0). Replace 'PP' with the port number your machine listens on (usually 7 or 9).
[edit]Remote Wake On LAN via Port Forwarding
To remotely wake up a computer over the Internet using Wake On LAN- follow these instructions:
1 - Create a port forward rule on the Web Interface (Applications & Gaming -> Port Range Forward) to the chosen ip:
- Here, 9 is the default, but you can use any port number so long as your client wake-up application can talk to a port other than 9. Most WOL services will use either UDP port 7 or 9.
- 192.168.1.254 is just an IP address in your LAN's subnet; it can be any IP, as long as it is not assigned to any device on your network.
2 - Add a static ARP entry by typing the following line into the Administration -> Commands section of the Web Interface and then saving with Save Startup.
- Do not change the FF:FF:FF:FF:FF:FF MAC address; this is a special MAC address used when broadcasting. WOL magic packets are constructed using the MAC address of the target computer, but should be and almost always are sent via broadcast; the MAC address used here controls with how the packet is sent, not how it is formed.
- The 192.168.1.254 IP address should correspond with the IP address you used in the previous step. Again, this IP should be in your LAN's subnet, and you must not assign this IP address to any actual device on your network.
- Explanation/rationale for this setup: Normally, WOL magic packets are sent to a special broadcast IP--to the final .255 in a subnet or to 255.255.255.255. Since port-forwarding to these special dedicated broadcast IPs does not work, what we need to do is create our own broadcast IP by taking an unused IP and assigning it a broadcast MAC and then port-forward to that.
- As an optional alternative, instead of arp, you can use ip neigh (which does the exact same thing as arp). Support for ip neigh was removed from DD-WRT starting with build 17650, and arp is unavailable in DD-WRT builds older than 5672.
3 - Reboot the router, or execute the startup commands manually.
- To wake your computer from the internet using the DD-WRT device DynDNS name (or if you know it, the public IP of the router), try one of the following services;
- Mestrona's online WOL. You need to forward port 9 udp in step one, to use this service.
- Wake-On-LAN Online. It works both on ports 7 and 9 and allows WOL by a single URL of the form: http://mobile.wakeonlan.me/?ip=HOSTNAME&mac=MACADDRESS. It also allows for scheduled wakeup over the internet.
- To use the WOL Magic Packet application from a second PC:
- Host Name: DynDNS name of your DD-WRT device.
- Subnet Mask: 255.255.255.255
- MAC Address: WOL computer MAC address, not the DD-WRT MAC.
- Click the green Send button.
[edit]Automatic Wake-On-LAN Daemon
The Automatic WOL daemon will send out a periodic wake on lan packet at the intervals you specify. This may be useful to keep a system online most of the time even if it is turned off. (eg: A Media Center PC).
For Interval you can enter a value in seconds as low as 15 seconds and as high as 86400 seconds (1 day).Host name should be the broadcast address for your LAN. eg: 255.255.255.255 or 192.168.1.255.SecureON Password is computers that have a BIOS feature that secures the WOL function. If you do not have a BIOS that requires this form of password then you can leave the box blank or type in 00-00-00-00-00-00.MAC Address(es) should contain the MAC address of the networked machines you want a WOL to be sent to on your LAN.
The packets generated by the WOL daemon are sent to UDP port 40000. You likely will not need to worry about this unless the system you are attempting to send the WOL packet is on another subnet or you are trying to monitor the packets.
note: the UI says that the Interval accepts a range of 1-86400 seconds but it will only send out a WOL packet at a minimum of 15 second intervals. All values below 15 are accepted but the interval will still be every 15 seconds.
A useful tool for watching the WOL packets on a Windows computer is available at www.depicus.com/wake-on-lan (use port 40000 when monitoring) Or you can use a more generic protocol analyzer tool like Wireshark.
[edit]WOL Scripts
- Wake up a specific host when triggered from the internet: Web Server Wake-up.
- To wake by name: Name-based WOL.
[edit]See Also (forum discussions)
[edit]References
Retrieved from 'http://wiki.dd-wrt.com/wiki/index.php/Wake-on-LAN_%28tutorial%29'
Online Wake-on-LAN Services
Here are some websites that allow sending magic packets to boot up a computer over the internet. They are free services that can be used by anyone.
6. Wake-On-LAN Online
This webpage is able to send the required packet data to your computer over the internet. A useful feature is the scheduler that allows you to send the magic packet on a specific day and time up to a week in advance.
Enter the external IP address and MAC address of the target computer into the boxes. Then press “Wake Up my PC!” The service seems to use both ports 9 and 7 by default but you can add your own with “:[port]” after the IP address. Multiple MAC and IP addresses can be used if you separate them with commas.
Visit Wake-On-LAN Online
7. Depicus Wake on LAN over the Internet
In addition to the Windows tools from Depicus, they also have a page on their website that can send the magic packet over the internet to your computer.
The external IP Address and MAC Address of your computer is required. The subnet mask and password boxes can be left alone if you have no specific need to change them. The page also says the port can be left at the default of 4343 but we got an error if the box was empty. Port 9, 7, 4343 or anything more specific if you wish is fine.
Visit Depicus Wake on LAN over the Internet
Wake-on-LAN from the Command Line or PowerShell
Using the command line or PowerShell to send Wake-on-LAN packets to another computer can be quite useful for business, professional users, in batch scripts and to make desktop shortcuts. Iexplorer 4 3 7 64.
8. Wake On Lan Command Line (WolCmd)
This tool is another entry in our list by Depicus and is a simple command line tool to send the Wake-on-LAN signal. The syntax is quite simple.
WolCmd [MAC address] [IP address] [Subnet mask] [Port]
An example would look like this:
wolcmd 26-63-A4-79-B8-12 192.168.0.40 255.255.255.0 9
The MAC address, IP address and subnet are required but the port will default to 7 if you don’t supply one.
Download Wake On Lan Command Line (WolCmd)
Another useful command line tool we found was simply called WOL. It additionally allows you to supply a password and a custom subnet.
9. Send-WOL PowerShell Script
There are a few PowerShell scripts around that can send a magic packet and this one is hosted on the Microsoft Technet Script Center. Download the script, open it and add the argument for the computer(s) you wish to wake.
Send-WOL -mac [MAC address] -ip [IP address] -port [port]
Save the script and execute it from PowerShell or the command line. Only the MAC address is truly required, the default port will be 9 if you don’t supply your own.
Download Send-WOL PowerShell Script
Use Wake-on-LAN to Start a Computer From your Smartphone
If you are unable to send the magic packet to your PC from another computer, an alternative option is sending it from another device like a smartphone or tablet. There are loads of apps around and the Android app we’ll look at is free, popular and does the job quite nicely.
10. Wake On Lan for Android
This app is quite easy to use because if the computer to start up remotely is switched on and available on the local network, you can find it automatically. Just press the add button and select the device from the list. It’s IP and MAC addresses will be added so you don’t have to do anything else. If you are connecting from outside the LAN, replace the local IP with the external IP or add a new connection manually.
All you have to do is press one of the devices in the bookmarks list to start the computer remotely. A handy function is the ability to add a widget to your home screen that can send the packet data to a selected device just by pressing the icon. By default the magic packet is sent three times, it can be changed up or down in the app settings.
Download Wake On Lan for Android
Test Wake-on-LAN is Working in Windows
If Wake-on-LAN isn’t working or you just want to test to see if the remote computer is receiving the necessary data, try using Wake on Lan Monitor. It’s another tool from Depicus and can be used to test if the magic packet is reaching the target computer.
Launch the tool on the computer you want to send the WOL signal to, set the required port and press Start. Then send a Wake-on-LAN packet from another computer using one of the options above. If the data is received, the tool will display it in the window. If you receive nothing there is something in your set up preventing the packet from being sent.
Note that different programs default to different ports when sending the magic packet. For instance, FUSION WakeUp on Lan and WakeMeOnLan default to port 40000 while WakeOnLANx defaults to port 7. If you are not required to set a port in the program, make sure you know what its default is during testing.
Download Wake on LAN Monitor
Make Sure Your Computer is Wake-on-LAN Ready
To enable the Wake-on-LAN feature in the BIOS, in addition to an obvious option which is usually named something like “Wake on LAN”, you may have to enable an option called “PCI Devices power on” in the ACPI configuration and power management settings.
You also need to make sure the LAN driver in Windows has the WOL feature enabled. Right click on (My) Computer > Manage > Device Manager > Network adapters. Double click on your Ethernet controller and look in the Advanced tab for “Wake on LAN”, “Wake from shutdown”, “Wake on Magic Packet” or similar.
Make sure it’s enabled. Also, go into the Power Management tab and tick “Allow the computer to turn off this device to save power”, “Allow this device to wake the computer”, and optionally “Only allow magic packets to wake the computer”.
While the system is switched off, make sure power is still getting to the network adapter by checking to see if the light is on near the connector on the motherboard or card. If not there is no power going to it then other settings may need adjusting.
‹ Previous12 View All You might also like:
5 Ways to Protect Your Computer Against NetCut’s ARP Spoofing Attack5 Tools to Automatically Wake Up Windows From Standby and Hibernation5 Ways to Remotely Start and Stop Services over the Network5 Ways to Remotely Access Apple Mac OS X from Windows5 Ways to Kill and View Processes on a Remote Computer 34 Comments - Write a Comment
Additionally, tools like Teamviewer, R-HUB remote support servers etc. also provide remotely turning on and accessing the computers. You can use the same.
ReplyHow you can wake up on LAN your PC if you’re not in the same network?
ReplyPage 2 might help you with that, those options can WOL over the internet which is essentially the same thing.
Replythis is “8 programms to use wake-on-lan to turn your computer on” describing exactly ONE way (WOL) – it is not 8 ways to turn a computer on … grrr :-P
ReplyWe called it 8 ways to… because there are not 8 programs or 8 websites, but a mixture. And you only have so many characters for a title.
Replyturn on and wake up is 2 completely different things. thats what he meant. Its clickbait in essence xD
ReplyWake on LAN will “turn on” your computer from off, wake up brings the computer out of sleep/standby. Two different things but “wake” is used for both.
Also, the commenter above did not mean the difference between turn on and wake, he was unhappy that the title says “8 ways…” when he believes there’s only one way mentioned.
ReplyThe PC that I wanted to start up has to be on Wi-Fi due to practicality. what I did was get one of those remote controlled smart outlets and set the BIOS to default to power on. I have a UPS and a gas generator so I’m not going to lose power to that PC otherwise. I just shut down the PC as normal then cut the power for about 30 seconds when I want to start it up.
Replyif the power to the network adapter is off while the computer is off, you need to be able to send a broadcast to it to wake it up.
in order to do that, an always on 3rd party device is needed that is in your home network like a tablet or old phone.
for that i wrote an app called wol proxy for android which can do the broadcast for you and still allow you to wake the PC:
in order to do that, an always on 3rd party device is needed that is in your home network like a tablet or old phone.
for that i wrote an app called wol proxy for android which can do the broadcast for you and still allow you to wake the PC:
play.google.com/store/apps/details?id=com.bianco.wolproxy&hl=en
ReplyHello, i am in brazil! Thanks ( Muito Obrigado!)
ReplySuper !!!!
Thanks a lot…
ReplyFor Android users – small app to wake up your PC
play.google.com/store/apps/details?id=ru.freask.pcwakeup
Description here develop.freask.ru/android/vklyuchenie-kompyutera-udalyonno-so-smartfona-na-android.html
It works even in cases where the computer behind the router NAT and port forwarding does not work (and it does not help if the PC is turned off).
Replyplay.google.com/store/apps/details?id=ru.freask.pcwakeup
Description here develop.freask.ru/android/vklyuchenie-kompyutera-udalyonno-so-smartfona-na-android.html
It works even in cases where the computer behind the router NAT and port forwarding does not work (and it does not help if the PC is turned off).
thanks
ReplyThanks a lot for providing the information!
I really needed something like this so that I could manage turning on my desktop when I am in college, and fetching necessary files.
Cheers!
ReplyI really needed something like this so that I could manage turning on my desktop when I am in college, and fetching necessary files.
Cheers!
This is exactly what I was looking for for years. Thanks Raymond.
ReplyExcellent work! :)
We have been trying to implement this technology for our college project, and this article of yours was indeed helpful. :)
ReplyWe have been trying to implement this technology for our college project, and this article of yours was indeed helpful. :)
thank you i just recently know about wake on lan
Replyone of the best articles i’ve read recently… thank you very much!
ReplyHa I woke up all my school pcs by this thanks
ReplyGood article! I tested a WOL for my Asus system and it worked like a charm. Saved me driving an hour to turn the PC on!
Cheers!
ReplyYou are just a genius ….
Wake On Lan Cmd Settings
Jeez….crazy
Replywow friend damn good, great for guys like me (net administrators)
Replyexcellent ! & Thanks
ReplyHi Raymond, this is really helpful. I was about to get a timer hardware to switch my office computer on and off at set timings. My only problem was I need to turn it on at times when the hardware is set to “off”. Have racked my brains over this…until I read what you’ve posted. A million thanks!
![Wake Wake](https://d1cy5sv9pggpkr.cloudfront.net/wp-content/uploads/word-image-217.png)
Thanks my friend, your post was of great help. It saved me a lot of money. I was going to buy a remote power switch and “ATX push to on” from Deltronix. Thanks again.
ReplyVery informative, thank you so much! I’ve been looking for a way to turn my computer on from school + use logmein =)
ReplyHi, Ray
You are a great man.
ReplyYou are a great man.
WHAT A NICE THING!!!! YOU JUST SAVE ME LOT WORK HOURS, because someone have lost the keys of the server’s room, I had to work remotly, but, for a mistake turned off the server, but, I was able to turn it on again with the software Fusion WOL, thanks a lot for your advise.
ReplyNice article, I already use VNC to control my machine but sometimes I forget to leave my PC on. This will help a lot, the only thing I need now is a decent router which supports dynDNS.
ReplyWake On Lan Command Powershell
Very cool!!! I used the wake up from the internet entered my home IP and MAC addy from my office and Voila! My home computer turned on. I used a remote support proggy to turn computer off and access everything THANKS!!!!!
ReplyGreat Post Buddy.
I blog it in my blog.
Thanks….
ReplyI blog it in my blog.
Thanks….
cool, thanks Ray!!
Replyvery helpful way Raymond good work
ReplyWell Mr Raymond,
Your site is really the Top!
I’ll be nearly 1 Year that I’m here as a member on this BLOG!
I’m really proud to be a member of Raymond blog.
Thanks for all!
ReplyYour site is really the Top!
I’ll be nearly 1 Year that I’m here as a member on this BLOG!
I’m really proud to be a member of Raymond blog.
Thanks for all!