Open AlexCherrypi opened 1 month ago
To use wol i believe you need to use the host network mode in docker As it needs to send the packets with mac address etc to a broadcast address and this won't work if u use bridge mode because it creates its own network which wouldn't be able to access ur home network
I'll try it out later and report back.
Also if I remember WOL works by meshcentral asking remote devices within a meshgroup that is online to send out the WOL packets to the device u want waking up, so I don't think the meshcentral server itself can wake the remote devices up
As far as I know, it does send WOL packets if in Lan or Hybrid mode.
Regarding the docker thing: way to much work. You'd have to specify the broadcast address manually and make the system not ignore invalid broadcast packets for the network it is connected to.
But: specifying a port nevertheless is a good idea, especially for network monitoring / packet inspection.
ok so just looked at this, this is the line where it sends the packets
https://github.com/Ylianst/MeshCentral/blob/19d0df7e7f025823bf85eb10aa000489e41c01ec/agents/meshcore.js#L1001
so do we simply need to change 7
to 9
im guessing?
if thats the case, i think we can add a value inside of config.json like "wolport9": true
and if this value is true, we then use port 9 instead of 7 !?
I think so.
But what exactly is the difference between sendWakeOnLanEx_interval() and sendWakeOnLanEx(hexMacList) ?
Both functions send WoL packets...
I am just wondering if both have to be changed.
Is your feature request related to a problem? Please describe. I use MeshCentral in a docker container. I want to use WoL when the server is the only awake device in the Lan. Therefore I need a port that I can forward in docker so WoL (magic packet sent by server) works.
Describe the solution you'd like You could specify a port for the UDP WoL Magic Packet. You could do it like this: socket.bind({ address: addr.address, port: 9 });
But why port 9? Look here!
I might just create a pull request later, but right now I am lying in bed and just remembered this issue. So I found a potential fix. But I really don't want to get up to create the pull request right now. Good night!