Community discussions

MikroTik App
 
spookymulder84
newbie
Topic Author
Posts: 25
Joined: Sat Nov 11, 2017 1:37 pm
Location: Croatia

WoL packets not reaching the client in another network

Mon Jan 16, 2023 2:11 am

Hello guys!
Waking up the PC inside the same network works properly even though quick sniff shows that the packets are "discarded", WoL also works through the routers WoL tool when the correct interface is selected.
Trying to wake up the PC with a magic packet from another network or from Wireguard (Road warrior without NAT) doesn't work either. It doesn't work sending the packet to the broadcast address of the network (10.156.1.255) or directly to the device itself (10.156.1.25).
There's nothing blocking the packets in the firewall, and disabling the firewall doesn't help at all.
Is this normal? Should I even look for a fix or just use the Mikrotiks WoL tool for when I'm outside of the network?
You do not have the required permissions to view the files attached to this post.
 
User avatar
BartoszP
Forum Guru
Forum Guru
Posts: 2865
Joined: Mon Jun 16, 2014 1:13 pm
Location: Poland

Re: WoL packets not reaching the client in another network

Mon Jan 16, 2023 8:37 am

Are all devices in one L2 domain to let brodcasts broadcast?
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11433
Joined: Thu Mar 03, 2016 10:23 pm

Re: WoL packets not reaching the client in another network

Mon Jan 16, 2023 9:12 am

@spookymulder84: I suggest you to read about how WoL works ... e.g. wikipedia article would do. In short: WoL is layer2 function, those normally don't pass routers. And ROS doesn't implement any kind of helper that would allow cross-LAN WoL. Layer3 (IP) can not be used because when you need to use WoL, target's OS is not active ... and L3 is most often implemented in OS (NIC implements L1 and L2).
 
spookymulder84
newbie
Topic Author
Posts: 25
Joined: Sat Nov 11, 2017 1:37 pm
Location: Croatia

Re: WoL packets not reaching the client in another network

Mon Jan 16, 2023 3:18 pm

there was a quote of whole precedding post ... no need to do this ... most is able to follow stream of discussion ... use "Post Reply" button
Do you recommend any book or source where I could better understand the L2 and L3 protocols themself? I thought whatever you'd send a UDP packet to a sunbets broadcast address that the router would send L2 packets to each device on the network, but I suppose it's just sending IP packets to each device of that network instead, which can't work for a shutdown system, right?

Anyway, I've just setup a script that runs the WoL tool on the router and wakes up the PC, and I execute them with cURL over RouterOS api-ssl, and also a nice HTTP Shortcuts tool for Android which seems to be nice
Last edited by BartoszP on Tue Jan 17, 2023 9:08 am, edited 1 time in total.
Reason: unneeded quotation
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11433
Joined: Thu Mar 03, 2016 10:23 pm

Re: WoL packets not reaching the client in another network  [SOLVED]

Mon Jan 16, 2023 4:35 pm

No, I don't have any suggestion about books.

It's "cast in stone" that routers should not pass broadcast traffic between interfaces. That's one of points of having routers. And yes, one mostly wants to target single (well defined) machine with WoL packet, usually one doesn't want all machines on soem subnet to wake up (at the same time). So WoL magic packet actually targets a particular MAC address and IP address is not really important. If OS on target machine is alive, then it answers ARP queries ... those are used to map IP address to MAC address. For WoL this is not possible obviously, so one has to know the MAC address beforehand. One possibility is to query DHCP server ... it might still have mapping between IP and MAC (eitehr because lease is static or lease did not expire yet).
 
spookymulder84
newbie
Topic Author
Posts: 25
Joined: Sat Nov 11, 2017 1:37 pm
Location: Croatia

Re: WoL packets not reaching the client in another network

Tue Jan 17, 2023 1:04 am

there was a quote of whole precedding post ... no need to do this ... most is able to follow stream of discussion ... use "Post Reply" button
Well, I don't understand why each subnet has the .255 address as the broadcast address then. Wouldn't 255.255.255.255 do the trick then? I thought the point of having a .255 broadcast address of each network is to send a packet from another network for broadcasting to devices of the target network.
But yeah, I can see that the Magic Packet is too special for IP to handle it properly even if it could reach the network broadcast. I'll stick to the Rest API solution then:
curl -k -u admin:password -X POST https://10.156.255.1/rest/system/script/run --data '{".id": "wakeTheMachine"}' -H "content-type: application/json"
Thank you!
Last edited by BartoszP on Tue Jan 17, 2023 9:07 am, edited 1 time in total.
Reason: unneeded quotation
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11433
Joined: Thu Mar 03, 2016 10:23 pm

Re: WoL packets not reaching the client in another network

Tue Jan 17, 2023 8:53 am

Well, I don't understand why each subnet has the .255 address as the broadcast address then. Wouldn't 255.255.255.255 do the trick then?
Well, both addresses you mentioned are valid broadcast addresses. But the former one (x.y.z.255/24) comes handy if there are more than one IP subnet sharing same L2 infrastructure (same L2 broadcast domain) - yep, it doesn't make much sense but sometimes it has to be done. In that case using the former broadcast address helps to target only devices "in the right IP subnet".
The later broadcast address is mostly used by devices before they find out better IP settings (e.g. during DHCP discovery handshake).
 
User avatar
Buckeye
Forum Veteran
Forum Veteran
Posts: 887
Joined: Tue Sep 11, 2018 2:03 am
Location: Ohio, USA

Re: WoL packets not reaching the client in another network

Tue Jan 17, 2023 10:56 am

Do you recommend any book or source where I could better understand the L2 and L3 protocols themself?
Here's a good starting point, and from there you can go through the topics in this list. It's labeled as CCNA but most of the stuff is vendor agnostic. Good free resource.

Who is online

Users browsing this forum: kkeyser, rogerioqueiroz, tuckerdog, VinceKalloe and 91 guests