Energy-efficient home server - Part 1: Setting up Wake on LAN

1 min to read.

Welcome to our new blog series in which we present step-by-step measures to make your home server more energy-efficient. Today we start with the setup of "Wake on LAN" (WoL), a feature that allows you to start your server remotely when needed. In this first part, we will focus on the configuration under Ubuntu Server 22.04, a Fritzbox and a Lenovo model with the corresponding BIOS.

Step 1: Activation of Wake on LAN in the BIOS

To activate Wake on LAN, you must first enter the BIOS. This is often achieved by pressing one of the function keys during the restart, for example F2. On laptops with an "Fn" key, it may be necessary to press this together with the corresponding function key. Depending on the manufacturer, the option can be found in the system or network settings.

Step 2: Installing ethtool under Ubuntu

On the Ubuntu side we install the programme "ethtool" with the command:

bash
sudo apt-get install ethtool

To save the configuration permanently, we create a file under "/etc/systemd/network/50-wired.link". Make sure to note the data of your network interface, which you receive with the command "ip -a". The configuration file should look like this:

ini
[Match]
MACAddress=aa:bb:cc:dd:ee:ff

[Link]
NamePolicy=kernel database onboard slot path
MACAddressPolicy=persistent
WakeOnLan=magic

Replace the MAC address with that of your network interface and enter the name of the network interface under "NamePolicy".

Now reload all configuration files and restart the Wake-On-Lan service with the commands:

bash
sudo systemctl enable wol.service
sudo systemctl daemon-reload 

Step 3: Optional setup in the Fritzbox

The third step is optional and concerns the Fritzbox. Under "Home network" → "Network" → "Network connections", you can activate the option "Start this computer automatically as soon as it is accessed from the Internet" for your device. This allows you to switch on via a shared port or a VPN connection, but does not work with WireGuard.

With these steps, you have successfully set up Wake on LAN on your home server. In the next parts of this series, we will discuss further energy-efficient measures to make your server even more sustainable. Stay tuned!