How to use WOL to wake up OpenWrt router

Most of the posts I've seen here and also information on the openwrt wiki talk about using openwrt as a WOL server to wake up other hosts.

If our Openwrt hardware has an RTC and several USB-to-ethernet adapters, is it possible to do this:

  1. OpenWRT router auto-shutdown on certain days at noon.
  2. Another server needs to connect to the internet at a set schedule will send a magic packet over LAN to wake up OpenWRT router; the OpenWRT router connects to the LAN via a USB-to-ethernet adapter.

Is this possible? Will USB power management on OpenWRT cause any issues? Thank you.

1 Like

Depends on the hw, I'd say.

1 Like

Let's assume the hardware is compatible; is there a way to use UCI to set up Openwrt to wake up upon receiving a magic packet from a specific LAN interface? How do I configure what mac address/iface to listen on for the packet if I cannot setup via UCI?

I've never set up WOL before; so any pointers will be helpful. Thanks.

the network adapter must support WOL and be able to talk to the BIOS. In your case probably not.

1 Like

Hi - I am actually thinking of doing something similar. I am trying to configure an old laptop to act as home router/nat/firewall.

I am sure it had wol capabilities in old windows OS, but there's no settings for it in BIOS (very customized HP bios).

So, how can I configure the current OS (openWRT) ethernet interfaces to wake the laptop/router up?

I will be using both the integrated 1gbps NIC and two usb-to-eth 1gbps dongles. It will be enough if WOL capability works on the integrated NIC so I don't have to deal with usb dongles not being powered when laptop is shut down.

I do have another home server that can be configured to send WOL packets when router is unresponsive.

My problem/question is how to configure the interfaces in openWRT OS to enable WOL on them.

You could use ethtool to set wol on a device. You'll need to replace eth0 with your own device name. Wake on Lan needs to be enabled in the bios and you need to install the ethtool package.

ethtool -s eth0 wol g

To check if wol is enabled you can run

ethtool eth0 | grep Wake-on

You'd also need to put the same thing in rc.local in order to make it persistent over reboots.

Put the following in /etc/rc.local or in Luci System>Startup>local startup just before the "exit 0" line.

sleep 15
ethtool -s eth0 wol g
1 Like

Thanks a lot! I will give it a try!

Added to startup, double checked that after reboot Wake-on is g.

root@OpenWrt:~# ethtool eth0 | grep Wake
Supports Wake-on: pumbg
Wake-on: g

Powered off, tried sending a magic packet for that MAC address but it did not bring it up. Possibly the powerstate of the laptop/router is too low.

Hm... does this work only from suspend?

No should do from powered off too. What model is your laptop? Is the setting for wol enabled in the bios?

Does the Ethernet port on a connected device (such as a switch or other equipment) still indicate an active link state when the laptop is powered off?

It really depends on the way the power off is implemented and defined. If the power to the NIC is down, it cannot listen to the network for a wake command.

HP Envy 17t-j000. Bios is really sparse. No setting for WOL. Will continue to investigate.

Noap - no leds blink or are on when laptop is powered off. Makes sense if the NIC is totally down it won't be able to respond to magic packets.

I have another idea. zigbee button connected to laptop power button. When laptop is detected as unreachable, local home automation would 'press' the button.

What version is your bios? The latest is F.69 Rev.A from what I can tell. Perhaps updating the bios will add the feature?