So I recently wrote about how anyone can use remote access technology to remotely connect to their computers back at home as if they were sitting directly in front of it even though in reality, they are miles and miles away. That’s great and all but how on earth do we access our computers if they are either in Standby or Hibernate mode? Must we leave our computers turned on the entire time we are away just so we can take advantage of remote access? What if I leave it turned on but later realize I don’t need to make a remote access connection? How much energy is wasted? In my remote access article, I mentioned ever so briefly about a cool feature called Wake-on-Lan (WoL). Here, I’ll go over how we can actually utilize the feature so we can safely hibernate our computers while still having confidence that we will be able to remotely get in should the need arises.
What is Wake-on-Lan?
If you haven’t already, please read over this Wikipiedia article on the Wake-on-Lan feature in computers. Another good article to read is from a website called Depicus. I will also be using a service provided by Depicus’s website later on in the article as well. In a nutshell, WoL allows you to “magically” wake your computer up from a power state other than fully turned on. A utility installed on a computer or an online service can generate this magic packet (which consists of certain data along with the Media Access Control (MAC) address of the computer to be woken up) and have it be sent to the destination network or computer. The computer who has the matching MAC address as advertised in the magic packet will will then initiate a system start-up once it receives it. In order for this to work, one the main requirements is for the computer’s motherboard/BIOS to support the WoL feature. This is a fairly basic feature and so I’m guessing that most computers support this. If not, a firmware upgrade may be needed. By enabling WoL, you’re basically telling the computer that when you put it into standby, hibernate or even in shutdown mode, cut power to the components as necessary but whatever you do, continue feeding power to the network card! This allows the network card to detect any “magic packets” intended for it and if so, act accordingly. WoL and remote desktop access technology goes together hand in hand. Is absolutely necessary you deploy WoL technology? Certainly not. But that does mean you’ll have to keep your computer turned on and that doesn’t really play nice with your electricity bill.
1. One of the first things you need to make sure is that your motherboard/BIOS actually supports the WoL feature. In most cases, it should but it doesn’t hurt to check. Also, if the feature is somehow disabled in your BIOS, you’ll need to enable it to utilize WoL. If your current motherboard’s firmware doesn’t support WoL, you might want to check if a newer version does support it and if so, decide whether to install it or not.
Head into your computer’s BIOS and find the WoL feature. It can be found either in the Power Management or Network section (or something to that sort).
Once you have confirmed that your motherboard does indeed support WoL and has been enabled, your next step is to configure your actual network card for the proper settings. Once again, modern network cards should support WoL features. If not, you’ll need to hunt down the latest drivers for the card. From my understanding, WoL does support wireless network cards but for some reason, many users seem to opt for the cable option instead and so that’s what I’ll be doing here as well.
We need to head directly into the properties of our network card. Start by right clicking on Computer in the Start Menu and choosing Manage. Once inside Computer Management, select Device Manager from the list. Drill down to the Network Adapters category. You should now see every network card interface installed on your computer. Double click on the network card for your wired connection. Be sure you are not selecting your wireless network card instead. In the Properties window, head over to the Power Management tab. Here, you should see about three options. By default, every option was enabled for my network card. Do the same for yours. To be on the safe side, restart your computer after making the (if necessary) changes.
How do you know everything is good to go? Simply put your computer into Standby or Hibernate mode and look at your network card. If WoL is truly active, the network card’s status lights should still be turned on. This means that the card is drawing power and listening for the magic packet. If you got this far, don’t congratulate yourself yet because this was just the easy part!
2. If you’ve been following along so far, you’ll already know that in order to wake our sleeping computer, we send a magic network packet addressed to the network card’s MAC address. Unfortunately, for some reason unknown to me, Windows doesn’t include a default utility or method (as far as I’m concerned) to actually send out this magic packet. Therefore, we need to rely on third party utilities or services to perform this feat. Here is wherein the problem lies and it definitely helps if you have a basic knowledge of how networking behaves to understand everything. If we need to wake a computer using WoL on our local area network (our home network for example), everything works as expected. We use another computer installed with some type of utility to send out the magic packets and our sleeping computer will receive it. Why is that? Well, because there is nothing blocking the packet from traveling to our destined computer as we are within the boundaries of our home network. It just works.
As you can see, this really doesn’t concern you unless you live in a huge mansion and don’t feel like walking to another part of the house to access your personal computer. For the majority of us, we usually need to remotely access our computer from the “outside” world and that I mean from the Internet. What’s the difference you ask? Well, in most cases, your home network is behind a router/firewall and without making the proper exceptions, the device will simply drop our magic packets sent over from the Internet. Therefore, our sleeping computer will never receive the packet and will not know to wake up. In order to remedy this problem, we need to configure port forwarding for our magic packets.Even if you are using the Logmein service for remote access, you will still need to configure Wake-on-Lan unless you are using the professional version of Logmein. In the free version, you are not able to remotely wake a computer via Logmein’s interface.
First we need to give our computer a static IP address if you haven’t done so already. Go over my remote desktop access article and in the beginning, I detailed how to do so. In my example, I gave my computer a static IP address of 192.168.1.50.
We now log into our router and configure the port forward. If you are not sure of how to access your router, check out Portforward.com. The magic packet by default uses port 9 UDP but we can configure it for a different port if you need to wake more than one computer in your network. More on this later. For now, create a port forward for the magic packet with a port number of 9 UDP (I choose a random port as seen in my picture) to your computer’s static IP address.
3. Once you have properly configured the port forward, we now need to find your network card’s MAC address. Open up a command prompt (type cmd in the Start Menu search) and type in Ipconfig /all. You’ll see a bunch of information pertaining to every single network card in your computer. You’ll need to find the one that belongs to your wired connection. The network card’s MAC address is labeled the Physical Address so look for that and copy it down somewhere.
4. Next, we need to know our current public IP address. This is the actual IP address you use to access the Internet and also how the Internet can communicate with you as well. Simply head over to Whatismyip.com and copy down your public IP.
5. We should now have all the information required to utilize WoL. Put your computer to either sleep or hibernate mode. Once again, check to make sure that the network card’s status lights are still present. We now head over to Depicus’s Wake on Lan webpage to send our magic packet from another computer. There are numerous other online services that aim to help you send a magic packet but I like this one because it allows use to actually specify a port number. Others usually just stick with the default port 9.
Type in the information we have found earlier in the appropriate fields. For the subnet mask, it’s usually safe to just type in 255.255.255.255. Remember to also use the correct port number.
Once all the information is typed in, hit the Wake On Lan button and the magic packet will be sent. If everything went according to plan, your computer should immediately wake from its slumber. Give it anywhere from 30-40 seconds for the computer to fully initialize before remotely connecting to it using the remote access method of your choosing.
If you have an iPhone, you also could send the magic packet from that device by using apps designed specifically with WoL in mind. One very awesome app is called iWOL by Sergio Rodrigues. If you’re looking for a free alternative, then try NetAwake.
6. After you finish with your remote session, what should you do? Well, you’ll most likely want to put the computer once again in the hibernate or standby mode in case you need to re-access it again. I’ll explain why you shouldn’t shut down your computer in the additional notes section below. If you are using TightVNC or Logmein, you should be able to hibernate or put the computer in standby by heading into the Start Menu and selecting the appropriate option as how you would normally do it. However, if you are using Windows Remote Desktop, you might not have the option to power down your computer in the Start Menu. You’ll only be able to Logoff or Disconnect, as seen here in the picture:
The problem here is the computer will still be powered on if you choose either option. The computer will then have to wait until the desired idle time has passed as indicated in the configured power scheme before putting itself in hibernate or standby mode but that’s not acceptable! If you aren’t using it, then it should be turned off! Simple as that. But how do we do that if Remote Desktop doesn’t give us the option to? The answer is very simple. On your desktop, hit the Alt+F4 key combination and you’ll be presented with a drop down dialog box that allows you to select what you want to do with the computer. Very handy indeed!
Additional Notes of Interest
There is a method, however, to enable broadcasting. By default, many home routers will automatically use the 255.255.255.0 subnet for your home network. The broadcast address for this subnet is 192.168.1.255 (which is the last usable address in the network), or something of that sort. However, many routers like Linksys does not allow you to port forward to that broadcast address, as seen below:
The next method I’ve read about deals with changing your default subnet. What if we change our default subnet from 255.255.255.0 to 255.255.255.128? Our broadcast address in that case would then be 192.168.1.127, which is well within range. By doing so, your network would then be split in to two segments with each segment only having a possible of 126 (128 subtract 2 as each computer cannot use the start of the subnet address along with the subnet’s broadcast address) IP address to be assigned. This shouldn’t normally be a problem as who actually connects that much devices in their home networks anyways?
Once again, we change the subnet within our router configuration webpage:
At this point our computer will still get Internet access but we are in the wrong subnet. Our subnet is still that of 255.255.255.0. We need to head back over to our IP settings and manually configure it to be that of 255.255.255.128.
In our port forwarding page, we should be able to specify the address of 192.168.1.127 as our port forward IP address. If you’re lucky, this should work. However, this method fell short once again in my scenario. Hopefully you’ll have more luck than me. I’m led to believe that my Linksys router (WRTU54G-TM, I use T-Mobile @ Home) is not able to send packets originating from the Internet to a broadcast address in my private network. This could be labeled as a security measure but it’s irritating that I don’t have a option to disable it. For brave users out there, you can flash your router to a custom firmware such as the popular DD-WRT to unleash your router’s true capabilities. And one of those capabilities is using broadcast address! Sadly, the firmware doesn’t support my router model.
This issue really shouldn’t be that big of a deal as I may have made it out to be. If you only need to remotely control 1-2 home computers, or even 3 or 4, you are still able to provided that you give each computer a unique WoL port number (along with a configured static IP address) and properly set up port forwarding. Once you have a whole network of computers however, then this method wouldn’t be practical. But as always, if anyone has any suggestions to tackle this problem, I’m all ears, trust me!
– As you may have already guessed, there are a lot of information needed *beforehand* in order to send a magic packet over the Internet to your router. You’ve got your public IP address, the MAC address of the computer you wish to wake up, the subnet address and the port number. It’s best if you kept this information in a simple text file on your thumb drive and either lock up with a password or deploy some type of encryption on the thumb drive itself. If you find your public IP address always changing, you’ll definitely want to look into DynDNS. This helps attach a fixed namehost to your public IP address. Anytime your public IP changes, DynDNS will help you automatically register the change in their database and you’ll be able to continue to reach your home network over the Internet with that same namehost.
– If you have broadcast port forwarding issues like me, then it’s a good idea to never actually shut down your computer if you think you might need remote access. Reason being that when the computer is turned off, there is no IP address configured for the network card (even though you gave it a static IP). If there is no IP address, then sending a magic packet in this case will do you no good because the router believes there is no computer on the network with that IP address even if you’ve properly configured port forwarding. To counter this problem, you’ll need to create static IP to MAC address mappings in your router. Many routers most likely will not allow this and so you’ll have to use a custom firmware like DD-WRT. Also, your router might flush the current IP to MAC address mappings in the table after a while and if this happens, the magic packet will not be able to reach its destination.UPDATE: Digging around in my router I found a feature called Static IP Assignment. This allows me to “reserve” a specific IP address for a specific computer based on its MAC address. Once configured, every time that computer or device requests an IP address from the router, the router will look upon this table and see if there is a specific IP address being reserved for this computer. If there is, then assign it to the computer. This way, there will always be a binding between a specific MAC address to a specific IP address! This solves the issue of the router occasionally flushing out the ARP table. If the table is flushed after a period of time, then you wouldn’t be able to send the magic packet to that computer and that defeats the whole purpose of WoL. Now, I’m lucky to have found this feature in my router. Your router obviously can differ from mine.
Once I got this configured, my router will now know that every time a packet arrives destined for that MAC address, it knows it belongs to the 192.168.1.50 computer. It knows to forward that packet (port 9 UDP) due to my port forwarding configuration. I have tried this and it has successfully worked! I now can send a magic packet over the Internet and power on my computer even if it was completely shutdown! Very cool indeed!
In the End…
Wake-on-Lan is a very important feature when talking in conjunction with remote access. Without it, we would have to leave our computers turned on every time we leave the house because we *might* have a need for remote access. That’s a lot of energy wasted. The concept of WoL is pretty easy to grasp but it’s actually quite complicated when viewed from a networking standpoint. A lot of things have to be just right before the feature can work. I did wish more home routers would natively support the feature. Heck, you even need a third party utility in order to send the magic packet! Maybe it’s time for a WoL replacement?