1. Confirm that your device supports WOL. This is usually in the spec sheets or you can check the boot menu to see if this is available. Most enterprise servers will have this available.
2. Once confirmed, simply run the "ethtool eth0" command. Now, depending on how many network interfaces you have, you may need to do a quick "ifconfig" to see which interface is active and available for WO (eth0, eth1, etc).
Check the output of this command for the following lines:
Supports Wake-on: g ---> If this is 'g' this means WOL is supported
Wake-on: g --> 'g' indicates that WOL is enabled. Otherwise, you will need to enable it (see step 3)
Wake-on: g --> 'g' indicates that WOL is enabled. Otherwise, you will need to enable it (see step 3)
Link detected: yes
3. To ENABLE WOL for the associated interface adaptor you found in step 2, issue the following: "ethtool -s eth1 wol g". In this case, I am enabling WOL on etl1 interface
4. At this stage, it is wise to test and cofirm it works by issuing the so-called "magic packet". There are a number of apps and online programs that provide this functionality. Personally, I liked the "Wake on Lan Wan" Android App found here. You can use any number of these but make sure you get the correct MAC address using ifconfig for the activated adaptor. Some have better GUIs but this app worked fine for me. at this stage, PLEASE test WOL on your local LAN (to ensure it is working as expected) BEFORE you proceed to step 5.
5. I found that the settings for WOL do not persist across reboots on OEL. As such, I took the following steps to make sure the persist.
touch /sbin/ifup-local
chmod +x /sbin/ifup-local
chcon --reference /sbin/ifup /sbin/ifup-local
#!/bin/bash
case "$1" in
eth1)
/sbin/ethtool -s eth1 wol g
;;
esac
exit 0
Confirm this works by making sure you shutdown/restart and retesting WOL.
6. If you got to this stage, the next question is...How can I enable this when I am on WAN instead of LAN. Here is where things get interesting. I found a number of conflicting articles on the feasibility of WOL working via PORT FORWARDING as the device is off and the WOL functionality operates at a different Network Layer. Also, your router may not allow the port forward. I tried forwarding ports 7 and 9 (TCPUDP) and also tried the BROADCAST IP..but nothing worked. In my case, I have a ASUS N66U router and despite these steps, I was unable to use port forward to do WOL using my public IP address.
The ONLY way I was able to get WOL working remotely was via VPNing to my local network. Doing this allowed me to succesfully send the magic packet and turn the server on.
Pretty cool stuff but I would be curious to know if its possible to do this without VPN and if so, what step I may have missed. For now, I am perfectly ok with VPN.
No comments:
Post a Comment