A simple Python script that wakes your computer up through LAN/WAN (ip or domain name).
python3 wakeonlan.py [-h] [-i IP | -n DOMAIN_NAME] [-p [PORTS ...]] MAC_ADDR
For example...
- LAN
python3 wakeonlan.py 01:34:67:9a:cd:ff
- WAN with domain name
python3 wakeonlan.py -n your.domain.name 01:34:67:9a:cd:ff # or python3 wakeonlan.py --domain_name your.domain.name 01:34:67:9a:cd:ff
- WAN with ip
python3 wakeonlan.py -i 8.8.8.8 01:34:67:9a:cd:ff # or python3 wakeonlan.py --ip 8.8.8.8 01:34:67:9a:cd:ff
Default port of WOL is 9
, you can use -p
argument to specify a list of trying ports.
Note: To use WOL before you run this script, you may need to enable WOL function on both BIOS/UEFI and OS.