1.pip3 install wakeonlan
pip3 install wakeonlan
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting wakeonlan
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/07/90/e94cd9d407680a4fa376c4e24553123d14462de771a5d9138844a2d78b80/wakeonlan-3.0.0-py3-none-any.whl (4.7 kB)
Installing collected packages: wakeonlan
Successfully installed wakeonlan-3.0.0
2.wol.py文件内容
from wakeonlan import send_magic_packet
send_magic_packet('00:11:22:33:44:d2')##请替换成你打算唤醒的PC 的MAC地
3.开始唤醒:python3 wol.py
4.等不到一分钟,服务器就能ping通了
![](https://i-blog.csdnimg.cn/blog_migrate/71388ee390b084e8fce7185ecfe14e8e.png)
NAS中需要先设置好wol: