WakeOnLAN concept is used to Power on the system when you know its MAC address. This WakeOnLAN uses Magic Packet technology to power on the target system.
Brief note on setting up WakeOnLAN:
Let say we have two systems A and B. B wants to wakeup A remotely. So here are the steps for that
- Enter BIOS setup in A system. And Enable Wake on LAN option in it. (Name may be different in different systems)
- Now you need to enable WakeOnLAN for the NIC card also. Run the following command in A system.
$sudo ethtool eth0 -s wol g
Install ethtool if it is not there
$sudo apt-get install ethtool
- Notedown the MAC address of A's system. ( let's say aa:bb:cc:dd:ee:ff)
- Install wakeonlan on B's system
$sudo apt-get install wakeonlan
write a script for wakeonlan ( you can have it from here).
- Run the following command in B's system powering off A's system:
That's only a four step method. Have fun.... :-)
Not satisfied with the brief one.... Okay. Read on geek, there's more for you.
Magic Packet Technology:
Previously we had a problem of remotely powering on a system. So here comes a new technology, Magic Packet Technology to solve this issue. Both IBM and AMD claim that Magic Packet Technology was their idea but thankfully we all benefit from it.
In this technology a magic packet is sent to a powered off system for waking it up. The Network Administrator or Ethernet Controller when receives a magic packet targeted to it wakes the system. This involves three steps:
- Magic Packet Mode Enabled
- Magic Packet Frame Detection
- Magic Packet Mode Disabled
Magic Packet Mode Enabled: Before shutting down the system, it should go to magic packet listening mode for waking up remotely. We need to change BIOS settings and Ethernet controller for making it enabled (That's what we do with Step 1 & 2). After enabling it and shutting down, the system listens for a magic packet. It wont sends any packet out. It just listens for magic packet.
Magic Packet Frame Detection: If a magic packet targeted to a system, which is in Magic Packet Listening Mode, arrives it wakes up the system.
Magic Packet Mode Disabled: The magic packet listening mode should be disabled if a magic packet is arrived or external power is on. And restore the normal network configuration.
To send a magic packet we use WakeOnLan script (Step 4 & 5).
Coming to network related issues, Magic Packet Technology and WakeOnLAN works on Data Link Layer. It uses the port 7 or 9 or ethertype.
PS: The only difference of Magic Packet from normal Ethernet packet is Magic Packet has 16 duplications of 6 byte MAC address.
That's it. Hope you enjoyed.
Do comment if you have any problem with it.
Source: Magic Packet Technology