WoL and port forwarding issue

Hello,
I hope I can solve my problem with your help.
I have a Netgear R7800 router with OpenWRT 22 on it.
Now I have set up Wireguard there, it also works to connect the cell phone to the home network.

I installed Unified Remote Server on my media server (Windows PC with IP 192.168.0.201), this is software to start the server with the Android, hibernate it and put it to sleep.
So I opened ports 9512 in the router (TCP and UDP).

However, starting the PC or controlling it remotely does not work when I am outside the home network without a VPN.
If I'm in the WLAN, I can easily wake up the PC with the Unified Remote app on my smartphone.

If I dial in with Wireguard VPN (of course without WLAN), I can control the server remotely, but only if it is switched on! WoL with connected VPN does not work!

What can be the reason?
Why doesn't port forwarding work as I would like to wake up my PC without a VPN?
And why can't I wake up the server with connected VPN?

With kindest regards
Martin

Have a look at luci-app-wol, to use your router's webinterface to wake up your computer. Wireguard is a level 3 protocol, with its traffic getting routed to its destination, while wake on lan is implemented at level 2 (needs to be called from within the house^wbroadcast domain) - you can't trigger it through a wireguard tunnel.

1 Like

Thank you for your reply.
So I have already installed and used the Wake on Lan module. Also works with connected VPN.

However, this is not the solution I would like to have, since it must be possible to start the PC via an Android app, not only do I have to do the WoL, but also others from my family.

Is there no way to do the WoL with Wireguard?
And why doesn't WoL work with port forwarding?
Which configuration files would I have to send you there so that a solution can be found?

Thank you

Correct.

There are no ports on layer 2.

None, it's fundamentally impossible.

Thank you!

But with the stock Firmware it was possible to open only the ports, which was used for the Unified Remote App.
So it was possible to Wake on wan from my smartphone (without vpn).
And with openwrt this is not possible?!

Try forwarding UDP port 9 to the broadcast IP address of your LAN, or create a static lease / arp entry for your server.

Port 9 I have just forwarded.
But it doesn't work.

How do I create a Arp entry?

Thank.you

The first suggestion in the link above was to forward the packet to the broadcast IP address of the LAN, which means 192.168.0.255 (assuming that the netmask is 255.255.255.0).

Keep in mind that this is just a shot in the dark.

Normally the magic packet must be broadcast to the entire L2 network.
In your case you are trying to forward it from WAN to the device that needs to be woken up (by its IP address).

If the MAC address of the server is missing from the router's arp table (because the server is down), the packet cannot be forwarded.

So the idea is to make the arp entry permanent.

uci add network neighbor
uci set network.@neighbor[-1].interface='lan'
uci set network.@neighbor[-1].ipaddr='192.168.0.201' #Server IP
uci set network.@neighbor[-1].mac='11:11:11:11:11:11' #Server MAC
uci commit network
/etc/init.d/network restart.

Thank you very much @pavelgl
But i had to enter "sleep 30" in the local start script before ip neigh.
so now it works to wake the pc up from the internet.

But now I have another problem.
I have opened the port from unified Remote, bit with the app on my android smartphone I can not send the PC to hibernate or shutdown. When I am in the VPN or WLAN so it works.

So the WoWan does not work how it should.
When i reboot the router, the the start script is working. It makes the Server in arp to permanent.
But after a few minutes (I didn´t count exactly), and when i done the server in hibernation mode, then the arp status is moved to incomplete (picture 3).
And I´m not able to start the PC from the internet or also from the VPN. Only in the WLAN does it work.

What can be the problem?
1


3

does anybody know a solution?

A solution to what? You do not read the links provided nor follow the advice given.

There is a proper and elegant way to create static arp entries provided by Mikael (thank you @mikma !), it was pointed out to you, but you decided to insert commands into /etc/rc.local.

I have created a permanent arp entry for a non-existent device on several OpenWrt versions (including 22.03.0) and I cannot reproduce your problem.

And finally, what is the actual IP address of the server - 0.201 or 0.254?