This is a pretty short post on how to use pfSense to send ‘Wake On LAN (WOL) magic packets’ to an endpoint – in this case a server. I should mention that the servers I’m setting up for WOL do have their own IPMI (Intelligent Platform Management Interface) port which I can logon to and initiate a power on but that involves jumping on to a few web interfaces or SSH connections. Using Wake On LAN will let me send a magic packet to all of them in one go through the pfSense interface.
It goes without the target devices must support Wake On LAN and the pfSense device must have connectivity to the relevant network.
pfSense Wake On LAN Setup
First off logon to the pfSense device and then browse to Services –> Wake On LAN
We are presented with a menu giving the option to send a magic packet on demand or to setup devices which will be remembered by pfSense to make future power on requests easier.
As an example, here I send a WOL magic packet to a single device on my LAN interface.
Next I’m going to add a device to the permanent list in pfSense. First click on the Add button, this will take us to a new page where we select the pfSense interface to send out the WOL packet, enter the MAC address of the target device and finally provide a useful description. Once all the fields are populated click Save.
We now have a device added to our WOL list. There are a number of actions that can be performed on this entry. We can edit it, delete and finally send an individual magic packet. As you can see there is also an option to ‘Wake All Devices’ which is what I will use once all my systems are added to pfSense.
I know this isn’t the most amazing guide but this functionality is really useful to me. When I’m away from home and want to power on my lab environment remotely this really comes in handy. I can VPN to my pfSense device and then power on all my lab devices from one interface rather than having to connect to each individually.
How do I program wake on lan automatically? I want every Thursday to open at the hour I want. Thank you
The best way would be to create a cron job (scheduled task) on the pfSense box. The command you need for WOL is – /usr/local/bin/wol -i [targetIP] [targetMAC]
For example if your target system has an IP address of 192.168.1.10 and a MAC address of 00:11:22:33:44:55, the command would be –
/usr/local/bin/wol -i 192.168.1.10 00:11:22:33:44:55
You can either setup the cron task on the command line or you could install the Cron package and do it that way.
thank you my friend this will be very useful.