【发布时间】:2021-01-19 07:24:25
【问题描述】:
我的简单家庭网络环境:modem(pppoe) + router + pc。
调制解调器是光纤到户 (FTTH) 的 FTTH 设备,通过光纤传输通信信号。
在 BIOS 中设置:
Advanced--Realtek Lan Controller--enabled
--Realtek Pxe Option Rom--enabled
Advanced--APM--Power on by PCI-E
在路由器中设置:
the ip (192.168.31.52) and mac address are binded together
我 android 的 qpython3 中的 start_lan.py 脚本:
from wakeonlan import send_magic_packet
send_magic_packet('mac address of my pc')
在我的android手机上打开wifi并从android的qpython3运行start_lan.py,我的电脑通过局域网在局域网上唤醒,成功!
然后我想通过WAN(外部互联网环境)唤醒局域网,有两种状态要讨论,一种状态保持路由器在网络结构中,另一种状态不。
状态一:
modem(pppoe) + pc
#Remove router
状态 2:
Keep the web structure as same as wake_on_lan via lan.
Set port forwarding on my router:
name protocol external port inner ip address inner port
wan TCP and UDP 30000 192.168.31.52 9
#the default port for wake on lan is 9.
When request my pc's public ip on the port 30000,it will be forwarded into 192.168.31.52 on the port 9.
这两种状态都在我的 android 的 qpython3 中使用几乎相同的 start_wan.py 脚本:
对于状态 1:
from wakeonlan import send_magic_packet
send_magic_packet('mac address of my pc',ip_address='public ip')
对于状态 2:
from wakeonlan import send_magic_packet
send_magic_packet('mac address of my pc',ip_address='public ip',port=30000)
执行脚本,我的电脑无法唤醒!FTTH设备重要吗? 如何解决?
【问题讨论】:
-
您是否转发了 UDP 端口 9?典型的端口转发是 TCP。
标签: python-3.x router wake-on-lan