How to setup Wake on Lan over internet

No comments
As you may know I have some homelab server, but I don't need it working 24/7. I just want have access to it when I need it and power off it all other time to save power.

Best way to wake up server is Wake-on-lan, but my server is behind my router and it didn't work over internet.

Let's configure our router to pass WOL packages for specific MAC to our server. By default debian have enabled WOL option, so no need any additional configuration on server.

First of all we need create static ARP record for our server.

[username@MikroTik] /ip firewall nat> /ip firewall nat print
/ip arp add address= mac-address=00:00:00:00:00:00 interface=local

Than add additional NAT rule to route UDP packets from 10000 port (for example) to our server internal IP and port 7.

[username@MikroTik] /ip firewall nat> /ip firewall nat print
Flags: X - disabled, I - invalid, D - dynamic
 7    chain=dstnat action=dst-nat to-addresses= to-ports=7 protocol=udp dst-port=10000
After that we can download any WOL tool from play market, configure it and test.
Here is my example. I set MAC to server MAC address, port to port from rule above, device IP and hostname to my external IP, Online status port to 22. When I press server button it power up and in few minutes (when ssh ready on server) I saw green circle that indicates that my server up and ready.

No comments :

Post a Comment