autowol - automatically turns on a local computer when needed
Copyright (C) 2018-2020 Mateusz Viste
http://autowol.sourceforge.net
===[ Why? ]===================================================================
I have a little PC that acts as a NAS and NFS server at home. This server is
being used only once or twice a day, so it would be wasteful to keep it always
on. I programmed the server so it shuts down itself automatically. I won't go
into details here since that's not the subject, I will only say that it
involves monitoring the TX counter of the server's ethernet interface.
The point is, that this server shuts down automatically, so whenever I want
to access it, I need to, well, turn it on. Doing it manually is unpleasant
when one is used to systems being available round the clock, so I created
autowol to help. As soon as I want to access my NFS server, autowol detects
that it is down and sends a WOL (Wake-On-LAN) packet to turn it on. My NAS
server boots up in under 15s, so the lag is very reasonable.
===[ How? ]===================================================================
autowol monitors your PC's outbound traffic. To do so, it relies on the pcap
library. It specifically looks for ARP queries that your PC broadcasts, and if
it sees a query related to the monitored IP address that goes unanswered, it
generates a Wake-On-LAN datagram and sends it out on the wire.
Since v0.9.2, autowol can be set to monitor also inbound ARP traffic. This
allows to set it up on a single machine in your LAN, so it wakes up a given
host when anyone tries to reach it.
===[ Limitations ]============================================================
autowol monitors ARP queries, which means that it is limited to monitoring
local computers - that is hosts that are in the same ethernet segment as you.
Modifying autowol to monitor different things (like TCP SYN packets) would be
fairly easy and could then make it work with hosts on different networks,
assuming the WOL packets would be routed correctly.
Because autowol relies on ARP traffic, it is also limited to IPv4 hosts (IPv6
does not rely on ARP for MAC discovery).
===[ Download ]===============================================================
autowol is distributed through its download area:
https://sourceforge.net/projects/autowol/files/
The source code is stored in the project's svn repository:
https://sourceforge.net/p/autowol/code/
===[ Contact ]================================================================
Wanna get in touch? You will find pointers to do so on my personal home page:
http://mateusz.viste.fr
===[ History ]================================================================
v0.9.3 [2020-11-12]
- rely on libpcap for ARP filtering: better performances,
- fixed --if support (was assuming Linux SLL encapsulation).
v0.9.2 [2020-11-06]
- added --inout (optional) argument,
- added '--if ifname'.
v0.9.1 [2018-05-27]
- shorter pcap timeout (autowol reacts much quicker now).
v0.9.0 [2018-05-10]
- first public release.
===[ License ]================================================================
autowol is distributed under the terms of the MIT License, as listed below.
Copyright (C) 2018-2020 Mateusz Viste
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.