sudo chmod +x /home/pi/wol.shĪdd this to the bottom sh /home/pi/wol. This is for tcpdump which needs elevated access to listen to eth0 and etherwake. Then put it in the sudo crontab to launch as root. A Fully-Qualified Domain Name (FQDN) with a DNS A record pointing to the IP address of your server. Apache web server installed on the servers with a configured virtual configuration host. I named the file wol.sh and made it executable. An Ubuntu 20.04 server with sudo user privileges, along with the Uncomplicated Firewall (UFW) configured. If the server is awake then it wont be listening for an arp request but send a few pings every now and then to make sure it is still awake. The primary idea is that it is run from my raspberry-pi which will wake the server if it notices a single arp request for the server. VarPing=`ping -s 1 -c 2 $target > /dev/null echo $?` PingInterval=60 #time interval, in seconds, between checks that the server is still awake. The wake script is as follows: nano ~/wol.sh Also on the server Wake On Lan needs to be enabled as mentioned in the other posts. Both are not installed by default on rasbian. The raspberry-pi dependencies are etherwake and tcpdump. The final solution I found for myself was writing a little bash script. I have a raspberry pi so I used it because it is low power and I don't mind keeping it on all the time, of course it could be run from any linux machine. I decided I wanted a solution to wake my media server automatically when accessed that wasn't dependent on dd-wrt. Obviously, you have to wait for a while after you sent the WOL packet, as your system needs to de-hibernate and it could take a few. Server doesn't need more setting than the suitable power management configuration to get the system down after an hour of inactivity (it could be done from System > Administration > Power management). Check it! In my case, it is called "Power on by Ring on Lan". The most of modern MBs provide this feature, but is disabled by default. Your motherboard needs to be listening on LAN port when is powered off.Your router has to bypass the magic packet (as the WOL packet is called) to your server, so you need to do the port forwarding.There are a lot of tutorials about it, but mainly you need to set up the following: So, as many have pointed, the answe is WOL (Wake On Lan). Further than sleep mode, what you're looking for is hibernate, as you want to save your state in your harddisk and shutdown completely the server.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |