Network

wakeonlan – Perl script

wakeonlan is a script sends ‘magic packets’ to wake-on-lan enabled ethernet adapters, in order to switch on the called PC.

This program uses UDP for sending the packet. The complete UDP packet, sent over an ethernet interface, looks something like this

[Ethernet header][IP header][UDP header][Magic sequence][CRCS]

The only goal of the script is to send this packet over the network. It expects no returning data, since the NIC only listens, and does not reply anything.

The scripts takes 2 arguments, the MAC-address of the NIC, and an IP address. The IP-address is tricky :

For a NIC on your local subnet, use the broadcast-address of this subnet. (e.g. subnet 192.168.10.0 with netmask 255.255.255.0, use 192.168.10.255)

For waking up a PC on a network behind one or more routers, some tricks must be used. When the routers forward directed subnet broadcasts, it is possible to use the broadcast address of the destination network. The problem is that many routers don’t forward broadcast packets, so the packet will never arrive at the network.

It is possible to send the packet to the remote net however, by sending it to the IP address of another host on that network that’s alive at that moment. The remote hosts will probably ignore the packet, but it has been seen by the listening NIC that’s also on the same subnet, and it will turn on the computer.

This is free and open source software.

Website: github.com/jpoliv/wakeonlan
Support:
Developer: José Pedro Oliveira
License: Artistic License 2.0

wakeonlan is written in Perl. Learn Perl with our recommended free books and free tutorials.


Related Software

Wake-on-LAN Tools
UpSnapSelf-hosted wake-on-LAN web application
gWakeOnLANSmall graphical utility that lets you wake up machines
Turn OnSmall GNOME utility
wakeonlanPerl script
virtwoldWake-on-LAN for libvirt based VMs
Awake on LanWake up computers remotely using Wake-on-LAN packets
wakeyManage and wake devices using Wake-on-Lan
UPSWakeSends Wake-on-LAN packets to bring systems back online
wol.rsWake On LAN magic packet command line tool and crate

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.

This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more.

Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted