Wake on LAN OpenWRT Configuration and Setup

Author

Reads 1.1K

Ethernet Cables Plugged in Network Switch
Credit: pexels.com, Ethernet Cables Plugged in Network Switch

To enable Wake on LAN on OpenWRT, you need to configure the network interface to use the WoL magic packet.

The WoL magic packet is a special packet that contains the MAC address of the device you want to wake up. This packet is broadcasted on the network and is received by the device's network card, which then sends a signal to the CPU to wake it up.

First, you need to identify the MAC address of the device you want to wake up. This can be found in the device's settings or documentation.

You'll also need to make sure that the network interface on your OpenWRT router is configured to use the WoL feature.

Discover more: Openwrt Interface

Setting Up OpenWRT

To set up OpenWRT, open the login interface and install the necessary packages for Wake on LAN.

You'll then need to restart your OpenWRT router, which should display the Wake on LAN option in the services tab.

Check this out: Dropbox Lan Sync

Wake on LAN

Credit: youtube.com, How to Power On your PC from anywhere with OpenWRT

Wake on LAN can be a real game-changer for remote work or managing multiple devices.

You can use etherwake to wake up systems via cron, sending a wake-up packet to the MAC address of the device. All you need is boot support to be enabled.

I've personally used etherwake with a USB HID device to sign into work systems at boot, send emails I'd parked at the end of the day, and make it look like I was being productive before I woke up.

There are two ways to wake up machines, either by automatic wake-up every time the router starts or by running a script.

To wake up a machine manually, you can run the command /etc/init.d/etherwake followed by the name of the machine you want to wake up.

If the machine was turned off using the system, it should wake up. If it doesn't, it's possible that the network card has WOL disabled.

OpenWRT Configuration

Credit: youtube.com, Video Updated: OpenWRT Router Walkthrough: Basic Settings & Easy Setup Guide

To configure OpenWRT for Wake on LAN, start by logging in to your OpenWRT router and installing the necessary packages.

OpenWRT's Wake on LAN functionality can be accessed in the services tab after a reboot.

You can also install the luci-app-wol package using opkg install, which brings a WoL menu close to what you want.

Expand your knowledge: Openwrt Install Tailscale

Create API Endpoint with OpenWRT LuCI

To create an API endpoint with OpenWRT LuCI, you'll need to follow a similar process to installing and configuring etherwake. Log in to your router and install the necessary package.

You'll then need to edit the /etc/config/etherwake file to configure the demon. This file has two main sections: one for setting up the demon's behavior and another for defining the target machines.

In the first section, you'll want to set up the demon to listen on a specific interface, such as br-lan. This is where the wake packets will be sent. The broadcast option allows you to send wake packets to the broadcast address 255.255.255.255.

You can define multiple target machines in the config section, each with their own MAC address and name. If you enable the wakeonboot option, the router will automatically wake up the specified machines when it starts.

Curious to learn more? Check out: Install Wake Tower Speakers

Bridging Wan to Lan in OpenWrt

Credit: youtube.com, VLANs in OpenWrt 21

To enable Wake on LAN, first log in to OpenWrt and install the necessary packages.

You can find the Wake on LAN menu in the services tab after restarting OpenWrt.

The luci-app-wol package brings a WoL menu that's close to what we want, but to customize it, we need to dig deeper.

To find out how this is made, change directory to the luci basedir, which is /usr/lib/lua/luci in this case.

If we add our page directly at the root, we get anonymous access to the WoL Interface.

To install and configure etherwake, log in to your router and install the required package.

The configuration file for etherwake is located in /etc/config/etherwake, where we can define the behavior of the demon and specify the interface to listen on.

The interface to listen on is typically the local network interface, such as br-lan.

We can also define multiple target sections, each with a MAC address and a name for easy scripting.

If we enable the wakeonboot option, all machines with this option enabled will be woken up at boot time.

See what others are reading: Openwrt Luci

Testing

Credit: youtube.com, This is how I can remotely power on my computer [Wake on LAN]

In a shutdown state, you can see Port 3 (the interface connected to the computer's network card) from the switch, and its speed is only 10M, just like the setting.

If WOL is not configured, the Port Status will directly display as Down after shutdown.

You can shut down the computer, then directly send a Magic packet from your phone to wake it up using OpenWrt.

After pressing the send key, you'll see the packet's data, which is quite simple: category 0x0842, followed by ffffffffffff, and then the target MAC address repeated 16 times.

The computer will wake up and enter the Windows login screen, and the switch's Port 3 status will also return to normal 1000M.

Here's an interesting read: Openwrt Switch

Thomas Goodwin

Lead Writer

Thomas Goodwin is a seasoned writer with a passion for exploring the intersection of technology and business. With a keen eye for detail and a knack for simplifying complex concepts, he has established himself as a trusted voice in the tech industry. Thomas's writing portfolio spans a range of topics, including Azure Virtual Desktop and Cloud Computing Costs.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.