ScottESanDiego / virtwold

Wake-on-LAN for libvirt based VMs
BSD 2-Clause "Simplified" License
44 stars 9 forks source link

WoL from AVM fritzbox wont work #4

Open soonic6 opened 1 year ago

soonic6 commented 1 year ago

Hi,

I tried to wake up my VMs from my AVM Fritzbox 7590 Router (https://en.avm.de/service/knowledge-base/dok/FRITZ-Box-7530/36_Starting-network-devices-over-the-internet-Wake-on-LAN/), but it didn't work.

I attempted the same thing from my Windows PC using some tools, and that worked well.

Here are the packets from the router and Windows tools: image As far as I understand, the smallest packets for WoL only need the MAC broadcast address and the destination MAC repeated 16 times. This is what the AVM Fritzbox does... the Windows tools also add IP and UDP information.

If you have any further questions or need additional assistance, feel free to ask!

ScottESanDiego commented 1 year ago

Yeah, certainly something that doesn't match the filter I have setup here (which is to look only for UDP broadcast packets). Looks more like the example in https://wiki.wireshark.org/WakeOnLAN than what I see sent from Moonlight or NVIDIA Games.

In theory if you change var filter = "udp and broadcast and (len = 102 or len = 144 or len=234)" to just var filter = "broadcast" it'll work for you (albeit looking at way more packets than it needs to for now). Can you give that a try, before I go make some other changes to help reduce the false-positives?

soonic6 commented 1 year ago

i think this https://wiki.wireshark.org/WakeOnLAN#protocol-dependencies is the most common problem with wol. maybe it isn't a good idea filtering every ethernet frame instead of contacting AVM for changing their WOL implementation.

In theory if you change var filter = "udp and broadcast and (len = 102 or len = 144 or len=234)" to just var filter = "broadcast"

i did a short test with var filter = "udp **or** broadcast and (len = 102 or len = 144 or len=234)" to just var filter = "broadcast" but it didn't work. but i can do another test today only filtering broadcast

SimonFair commented 11 months ago

@ScottESanDiego I have been using your code as a basis for one of may projects.

I have added code but not created a PR as yet.

virtwold.go.txt

palves commented 5 months ago

I was scratching my head over why on GNU/Linux, the ether-wake tool wasn't working to wake up my VMs, while the wakeonlan tool works. I guess https://wiki.wireshark.org/WakeOnLAN#protocol-dependencies explains it. Thanks for the link. IWBN if virtwold Just Worked, though.

ScottESanDiego commented 5 months ago

So is listening for ethernetPacket.EthernetType == 0x0842 what's needed to make AVM work? I'm not clear what is needed to make this work.