GithubHelp home page GithubHelp logo

wakeonlan's Introduction

wakeonlan

This is some premature documentation for this project. Feel free to contact with comments or additions (good or bad).

Authors:

  • José Pedro Oliveira <jpo[at]di.uminho.pt> <jose.p.oliveira.oss[at]gmail.com>
  • Ico Doornekamp <ico[at]edd.dhs.org>

Table of contents:

  1. What is wakeonlan
  2. How does WOL work?
  3. How is it implemented here?
  4. Known to work hardware
  5. References

1. What is wakeonlan

This script sends 'magic packets' to wake-on-lan enabled ethernet adapters, in order to switch on the called PC.

2. How does WOL work?

WOL is based on the following principle :

When the PC shuts down, the NIC still gets power, and keeps listening on the network for a 'magic' packet to arrive. This packet must contain a certain byte-sequence, but can be encapsulated in any kind of packet (IPX, IP, anything). Take a look at the code for the magic sequence.

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.

For a more detailed description of the Magic Packet technology, check the AMD resources listed in the references section.

3. How is it implemented here?

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... Feel free to experiment on this.

4. Known-to-work hardware

  • 3Com 3c905B Cyclone 100baseTx on an Abit BP6 Motherboard; (Ico Doornekamp)

  • Intel EtherExpress Pro (i82557) with management chip built onto an IBM IntelliStation motherboard; (Sean-Paul Rees)

  • Intel EtherExpress PRO/100+ (chipset 82559) with a PXE boot agent on an ASUS P2B motherboard; (José Pedro Oliveira)

  • Motherboard: ASUS TUSL2-C; BIOS: Award BIOS / Power / Power Up Control / Wake On LAN or PCI Modem [Enable]; Network card: Intel Pro/100 S Desktop Adapter (chipset 82550) with PXE boot agent v4.0.22; (José Pedro Oliveira)

  • Motherboard: ASUS TUSL2-C; BIOS: Award BIOS / Power / Power Up Control / Wake On LAN or PCI Modem [Enable] Network card: 3Com Fast Etherlink TX 10/100 PCI (3C905C-TXM) with Managed PC Boot Agent (MBA) v4.30 (build 3) Pre-boot eXecution Environment (PXE) v2.20; (José Pedro Oliveira)

  • nVidia Corporation nForce2 Ethernet Controller on ASUS and EPOX motherboards; (Antoniu-George)

  • Macs: All Powerbooks; Energy Prefs: Wake on ethernet network Administrator access; (Denis Ahrens)

5. References

wakeonlan's People

Contributors

jpoliv avatar kai-burghardt avatar kaykayehnn avatar lpmi-13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wakeonlan's Issues

Unable to use public IPv6 for ip_address argument

When I attempt to use my server's public IPv6 ip address as an option for the script, I get the following error:

Use of uninitialized value in subroutine entry at /usr/local/bin/wakeonlan line 75.
Bad arg length for Socket::pack_sockaddr_in, length is 0, should be 4 at /usr/local/bin/wakeonlan line 75.

It looks as though using the IPv6 ip is not supported by the script at this time. Is that a feature that needs to be added, or am I using the script incorrectly?

Note: The script works correctly when using no ip_address argument or my local ip address

Possible to send "turn off" packet?

Hi there,

Thanks for sharing this amazing tool. Is there a supported way to send "turn off" commands to a MAC address using this or any other tool that you know of?

Thank you,
Tony

Program installs but won't run

I have been running windows since v3. I decided to move over to Linux. So please be kind to this noobie.

I am running Linux Mint 21.3. As I have done with other software, I installed the program from the software manager. When the install completes, there is a "launch" button. It will not run. Am I missing something?

I REALLY want to have this program working.

permit hostname for mac addr argument, resolved via /etc/ethers

It would be nice if we could specify a hostname in place of the MAC address argument, and for wakeonlan to attempt to look this up via nss/nsswitch/the ethers db (e.g. /etc/ethers).

Note that this would be to resolve a hostname to a MAC address, not to specify an IP for the WOL packet.

Examples

$ getent ethers coil
e0:4f:43:e6:2b:36 coil
$ wakeonlan $(getent ethers coil | awk '{ print $1 }')
Sending magic packet to 255.255.255.255:9 with e0:4f:43:e6:2b:36

getent(1) implies that the libc function to do this correctly is ether_hostton.

Unable to use DNS name for ip_address argument

In 0.42 version of wakeonlan, when trying to input my DNS name as the ip_address argument, it returns :

Invalid default IP address: (name of my DNS address).
With the same parameters on wakeonlan 0.41, it works like a charm instead. What changed? It seems that now ip_address argument only accepts digits.

Schermata 2022-04-23 alle 00 55

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.