Wake on LAN, machine on different subnet

Olivier Olivier.Nicole at cs.ait.ac.th
Mon Aug 24 10:55:04 UTC 2020


Colin Law <clanlaw at gmail.com> writes:

> On Mon, 24 Aug 2020 at 10:36, Olivier <Olivier.Nicole at cs.ait.ac.th> wrote:
>>
>> Colin Law <clanlaw at gmail.com> writes:
>>
>> > I am trying to use WOL to wake up a machine on a different subnet of
>> > my local network.  The subnet is accessible from the machine running
>> > the wakeup command.  I realise that WOL uses UDP, which will not
>> > normally cross the subnet boundary.
>>
>> Why do you assume UDP would not cross the subnet boundaries?
>
> My understanding may well be lacking in this area.  In
> https://en.wikipedia.org/wiki/Wake-on-LAN#Subnet_directed_broadcasts
> it says "A principal limitation of standard broadcast wake-on-LAN is
> that broadcast packets are generally not routed. This prevents the
> technique being used in larger networks or over the Internet."

True, but it would be the same for any broadcast packet, not only for
UDP packets.

> I
> assumed that the -i option in wakeonlan somehow got over this problem.
> I may well be mistaken.
>
>>
>> You need to clarify the picture, because my sugestion would be: "if it
>> works without using the option -i, don't use the option -i". But it is
>> obviously not the right answer, so the question is not clear enough.
>>
>> It appears to be a routing problem so you need to explain what are your
>> subnets, how they connect to eachother (NAT?) and all that jazz.
>
> It works without the -i only if I run it from another machine on that
> subnet, normally there is no other machine on that subnet.  This is
> the organisation:
>
> Internet
> |
> Router 1
> |_ Machine 1 (to be woken) on subnet 10.x
> |_ Router 2
>     |_ Machine 2 (the one triggering the wake) on subnet 73,x
>     |_ ...
>
> I have this arrangement so that the machine 1 (which is open to the
> internet) cannot access the 73.x subnet machines, but those machines
> can access machine 1, and the internet.  Router 2 is configured with
> Router 1 as its gateway.
> Perhaps this is just a matter of correctly configuring Router 2 to
> route the WOL package.  It is running OpenWRT so it may well be
> possible.  I have done some googling but not come up with anything
> particularly helpful.
>
> This is all because Machine 1 (A Lenovo X201 laptop) does not seem to
> have a BIOS option to auto-boot on power connection, so if the power
> fails long enough for the battery to run down it will not restart when
> the power is restored.

If Machine 1 has a fixed IP address, you can do a WOL only to that IP
address and that should solve your routing limitation on broadcast. Just
be sure that the ARP entry for that IP address is never expired.

If you plan to have a script sending WOL every 5 minutes, you can also
run that script on router 2.

Else you would have to look at "directed broadcat" for OpenWRT, which a
quick google did not give any glaring result.

Best regards,

Olivier


>
> Thanks for helping
>
> Colin

-- 




More information about the ubuntu-users mailing list