A command-line tool for managing and sending Wake-on-LAN (WoL) magic packets to wake up network devices remotely. This tool allows you to save device MAC addresses with friendly names for easier access and wake up devices either by their MAC address directly or using saved device names.
- Send Wake-on-LAN magic packets to wake up remote devices
- Save device MAC addresses with custom names for easy reference
- List all saved devices
- Remove saved devices
- Support for custom IP addresses and ports
- Configuration persistence across sessions
- Ensure you have Python 3.x installed on your system
- Clone this repository or download the script
- Make the script executable (Unix-like systems):
chmod +x wol.py
./wol.py <command> [arguments]Wake up a device using either its MAC address or saved name:
./wol.py wake <MAC_address/device_name> [--ip IP_ADDRESS] [--port PORT]Examples:
# Wake using MAC address
./wol.py wake 00:11:22:33:44:55
# Wake using saved device name
./wol.py wake mycomputer
# Wake with custom IP and port
./wol.py wake mycomputer --ip 192.168.1.255 --port 7Save a device's MAC address with a friendly name:
./wol.py save <name> <MAC_address>Example:
./wol.py save mycomputer 00:11:22:33:44:55Display all saved devices and their MAC addresses:
./wol.py listRemove a device from the saved devices list:
./wol.py remove <name>Example:
./wol.py remove mycomputerThe tool automatically creates and manages a configuration file in the user's home directory:
- Location:
~/.wol/config.json - Format: JSON file containing device names and their corresponding MAC addresses
- Created automatically on first use
- Python 3.x
- Standard Python libraries (no additional dependencies required):
- socket
- struct
- argparse
- json
- os
- pathlib
- Magic packets are sent using UDP broadcast
- Default broadcast address: 255.255.255.255
- Default port: 9
- MAC addresses can be specified with or without delimiters (: or -)
- Configuration is stored in JSON format for easy manipulation
- Ensure the target device has Wake-on-LAN enabled in its BIOS/UEFI settings
- Verify that your network allows UDP broadcast packets
- Check that the MAC address is correctly specified
- Ensure you have the necessary permissions to send network packets
- For wake-ups across subnets, ensure your router supports directed broadcasts
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.