Supports Wake On Pumbg
Today, we continue our series on readying the homelab for unattended access. Previously, we set up a Raspberry Pi to allow us to remote into our network via a reverse SSH tunnel. That's useful by itself, especially as a backup if our normal route of access (VPN) is down, but we can also use that same reverse SSH tunnel to do some other incredibly useful things such as waking up other devices on the network with wake-on-LAN (WOL). Today's tutorial will focus on precisely that: enabling our servers to be woken up on LAN, and configuring our RPi sleeper cell to wake those servers up. Let's begin!
Configuring Wake-on-LAN is a simple process on Alpine Linux. First, check if your network card supports Wake-on-LAN (WOL): # apk add ethtool # ethtool eth0 grep -i wake Supports Wake-on: pumbg Wake-on: d Supports Wake-on: pumbg means that WOL is supported, Wake-on: d means that it is currently. Supports Wake-on: pumbg Wake-on: g Current message level: 0x00000033 (51) drv probe ifdown ifup Link detected: yes Man sieht das das Wake-on auf g steht und dann funktioniert es auch. Ich habe aber keine Ahnung, was ich wo einstellen muss/kann, damit dort immer Wake-on: g steht. Supports Wake-on: pumbg The normal state is for wol to be disabled and all tutorials I've seen say that the desired more must be set prior every shutdown.
Enable Server for Wake-On-LAN (WOL):
1. On your server, install ethtool:
ethtool allows us to verify that our NIC can support wake-on-lan. It is also used to enable wake-on-LAN on Ubuntu.
2. Find the name of the network adapter you are currently using with the following command:
Supports Wake-on: pumbg. The “Wake-on” mode configured by default is “d”, which means that the network card will not switch on the server when it receives a magic packet but, as the network interface supports “g” mode (it is one the letters in pumbg) we can set the value of “Wake-on” to “g”.
If you don't already have ifconfig, you can install it with:
If you need help figuring out which network adapter you are currently using, look for the one with an IP address assigned. You can also look at which network adapter has had traffic go through it (the RX and TX packets line will have non-blank values):
In my case, eth0 is the network adapter in use, and chances are it probably is for you too. If you need help with this, feel free to ask me in the comments/forum.
Wake On Lan Debian
3. While you're here, record the address next to ether (highlighted above). That's your MAC address and that's how we will ultimately address the server when we are ready to wake it up.
4. Check to see if wake-on-LAN is available on your NIC with ethtool:
In my case that command would be:
If WOL is available on your card, you should see a line that appears as so:
We really only care to see that this line contains a 'g', indicating a that it will accept a 'magic packet' (the mechanism by which wake-on-LAN works).
N.B.: If you don't see it, all hope is not lost, you may just need to enable 'Wake-On-LAN' in the BIOS. This varies from motherboard to motherboard but almost all have this setting so look for it.
5. Enable the system for Wake-On-LAN:
Don't forget to replace eth0 with the adapter you're using if you have a different one.
Supports Wake On Pumbg
6. Create the script to insure that WOL is always enabled:
Linux Wake On Lan
Now, there's an unpleasant little 'feature' in OS's where the above setting gets reset after every reboot.
If you're using unRAID, this easily handled with the User Scripts plugin. Just create a user script with the following content and set it to run 'At startup of array' (make sure you have the array set to always start):
If you're using Ubuntu, we'll need to create a system service:
In this add the following:
Again, don't forget to replace eth0 with whatever network adapter you're using.
Enable the service:
Supports Wake-on: Pubg
That's it for setting everything up on the server side. Now, let's set everything up on our RPi (or whatever other device you have the reverse SSH tunnel set up on).
Install Etherwake on RPi:
7. Super easy job here. Just install etherwake on the RPi with:
That's all!
Test Everything Out:
8. Shutdown your server so we can test waking it up.
9. SSH (reverse SSH if working remotely) into your RPi.
10. Just like we did in Step 2 above, identify the network device in use on your RPi.
This is where A LOT of people trip up and why they fail to get wake-on-LAN/etherwake working. By default, etherwake attempts to send out the WOL magic packet on eth0 of the device it's being run on. If eth0 isn't in use, you'll get the following error message:
11. Send the WOL magic packet with the following command using the MAC address you found in Step 2/3 above and the RPi network device you found in step 10 above:
Example:
At this point, you should hear your server kick on and boot up!
As always, let me know if you run into any problems or have any questions in the comments below!
Centos Wake On Lan
Interested in this topic and others like it? Join our community and join in the discussion! We currently have a need for moderators so if you can help out it would be much appreciated!