Hello I'm using OpenWrt 22.03.5, and I try to remotely turn on my home server. I am not an experienced user of OpenWrt.
I'm using VLAN in my network: My Android phone is in br-lan.1 (192.168.1.0) and my server is in br-lan.2 (192.168.2.0).
My server is configured for listening for Magic Packet, I have also installed luci-app-wol, and now I CAN wake my server from LuCI (and probably from ssh using etherwake - I didn't try it, because both are not a solution for me).
My question is: how to wake my server using very convenient applications for Android (standard broadcast UDP Magic Packet)?
I don't why, but now it's not work for me, I don't know why, but I read that this is a problem to broadcast the Magic Packet to other interface (I'm not sure about this because I can see that when I try to wake, the LED in my router is blinking, so probably something is happening).
Because they are on different VLANs, they are in different ethernet broadcast domains. WOL is based on broadcast low level ethernet packets (below even IP traffic). As such it won't traverse a router, only basic layer 2 bridges and switches. VLANs prevent this.
This is how ethernet broadcasts work, it is fundamental to the network protocols. The only fix (other than using WOL from another device on that VLAN, like the router) is to move the devices to the same vlan.
Not really. If you search the web, you can find concepts like "IP directed broadcast", "WoL Proxy", "WoL gateway", but they are mostly used by specific vendors.
However, if your idea is to wake up the server with a single tap on your phone's display, there is a possible workaround using a shell script and the luci-app-commands package.
I wake up my office computer from home (over a wireguard tunnel) this way.
If you are interested (and your security policy is not too tight), I could share my approach.
If your phone is connected to a guest network, you need to create a traffic rule allowing the phone to access the router's web interface. If this is the case, MAC randomization should be disabled and you should set a static lease (unless the rule is set by MAC).