📡 Wake-on-LAN
Remotely power on devices across your network using magic packets.
New in v2.1.0: Wake-on-LAN with favorites management, batch wake, and status verification.
Quick Start
Access Wake-on-LAN from the interactive menu:
netscan
# Press 'z' for Wake-on-LAN
What is Wake-on-LAN?
Wake-on-LAN (WoL) sends a special "magic packet" to a device's network interface, triggering it to power on from sleep or shutdown state. Requirements:
- Target device must support WoL in BIOS/UEFI
- WoL must be enabled in BIOS/UEFI settings
- Device must be connected via Ethernet (WiFi WoL is rare)
- You need the device's MAC address
Basic Usage
# Wake a device by MAC address
python3 helpers/wol.py --mac 00:11:22:33:44:55
# Multiple MAC address formats supported
python3 helpers/wol.py --mac 00-11-22-33-44-55
python3 helpers/wol.py --mac 001122334455
python3 helpers/wol.py --mac 00:11:22:33:44:55
# Wake with custom broadcast address
python3 helpers/wol.py --mac 00:11:22:33:44:55 --broadcast 192.168.1.255
# Wake with SecureOn password
python3 helpers/wol.py --mac 00:11:22:33:44:55 --password MyPassword
Favorites Management
Save frequently used devices for quick access:
# Add a device to favorites
python3 helpers/wol.py --add-favorite "Office PC" --mac 00:11:22:33:44:55
# Add with optional IP (for status checking)
python3 helpers/wol.py --add-favorite "Server" --mac AA:BB:CC:DD:EE:FF --ip 192.168.1.100
# List all favorites
python3 helpers/wol.py --list-favorites
# Wake by favorite name
python3 helpers/wol.py --wake "Office PC"
# Remove from favorites
python3 helpers/wol.py --remove-favorite "Office PC"
Batch Operations
# Wake all favorites
python3 helpers/wol.py --wake-all
# Wake multiple specific devices
python3 helpers/wol.py --wake "Office PC" "Server" "NAS"
# Wake with delay between packets
python3 helpers/wol.py --wake-all --delay 2
Status Verification
# Check if device woke up (requires IP in favorites)
python3 helpers/wol.py --wake "Server" --verify
# Check status of all favorites
python3 helpers/wol.py --status
# Custom verification timeout
python3 helpers/wol.py --wake "Server" --verify --timeout 120
Sample Output
$ python3 helpers/wol.py --list-favorites
Wake-on-LAN Favorites
=====================
Name MAC Address IP Address Status
------------------------------------------------------------
Office PC 00:11:22:33:44:55 192.168.1.50 Offline
Server AA:BB:CC:DD:EE:FF 192.168.1.100 Online
NAS 11:22:33:44:55:66 192.168.1.200 Offline
Media PC 22:33:44:55:66:77 - Unknown
$ python3 helpers/wol.py --wake "Server" --verify
🔌 Sending magic packet to Server (AA:BB:CC:DD:EE:FF)...
⏳ Waiting for device to wake up...
✅ Server is now online (192.168.1.100)
CLI Options
| Option | Description |
|---|---|
--mac MAC | MAC address to wake |
--broadcast IP | Broadcast address (default: 255.255.255.255) |
--port PORT | UDP port (default: 9) |
--password PASS | SecureOn password if required |
--add-favorite NAME | Add device to favorites |
--remove-favorite NAME | Remove from favorites |
--list-favorites | Show all saved favorites |
--wake NAME | Wake favorite by name |
--wake-all | Wake all favorites |
--verify | Verify device woke up |
--status | Show status of all favorites |
--delay SECS | Delay between packets |
--timeout SECS | Verification timeout |
Python API
from helpers.wol import WakeOnLAN, FavoritesManager
# Send magic packet directly
wol = WakeOnLAN()
wol.wake("00:11:22:33:44:55")
# With options
wol.wake(
mac="00:11:22:33:44:55",
broadcast="192.168.1.255",
port=9,
password="secret"
)
# Manage favorites
favs = FavoritesManager()
favs.add("Server", "AA:BB:CC:DD:EE:FF", ip="192.168.1.100")
favs.wake("Server", verify=True)
# Wake all
for device in favs.list():
wol.wake(device.mac)
print(f"Woke {device.name}")
Troubleshooting
Device won't wake
- Verify WoL is enabled in BIOS/UEFI
- Check network adapter settings in OS
- Ensure device is on wired Ethernet
- Verify MAC address is correct
- Try different broadcast addresses
WoL across subnets
By default, WoL works within the same subnet. For cross-subnet wake:
# Use directed broadcast to specific subnet
python3 helpers/wol.py --mac 00:11:22:33:44:55 --broadcast 192.168.2.255
# Or use unicast with known IP (if ARP entry exists)
python3 helpers/wol.py --mac 00:11:22:33:44:55 --broadcast 192.168.2.100
💡 Tip: Some routers have WoL forwarding features that can relay magic packets to other subnets.