继续从这个问题
我想从我的自定义路由器(树莓派)发送用于局域网唤醒的魔术包。以下为网络图片;
我用了瓦克兰发送魔法包。然而,台式电脑并没有被唤醒......
这是设置信息。
拉斯皮(路由器)(当台式电脑切换时在)
$ ip a
1: lo: ~~~~~
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:df:31:9c brd ff:ff:ff:ff:ff:ff
inet 172.16.0.20/23 brd 172.16.1.255 scope global noprefixroute eth0
valid_lft forever preferred_lft forever
inet6 fe80::51dd:e5ef:c061:adb9/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: ~~~~~
4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 04:ab:18:3b:af:e2 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.1/24 brd 192.168.1.255 scope global noprefixroute eth1
valid_lft forever preferred_lft forever
inet6 fe80::83fa:6dee:9799:9a6e/64 scope link
valid_lft forever preferred_lft forever
5: vpn_vpn_nic: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
link/ether 5e:ab:14:17:ae:3a brd ff:ff:ff:ff:ff:ff
inet 192.168.0.20/24 brd 192.168.0.255 scope global noprefixroute vpn_vpn_nic
valid_lft forever preferred_lft forever
inet6 fe80::ebcc:65ba:a7f4:a21e/64 scope link
valid_lft forever preferred_lft forever
inet6 fe80::5cab:14ff:fe17:ae3a/64 scope link
valid_lft forever preferred_lft forever
$ arp
Address HWtype HWaddress Flags Mask Iface
172.16.0.91 ether 38:f9:d3:61:a4:2a C eth0
172.31.68.210 ether 00:ae:43:d1:c7:a2 C vpn_vpn_nic
192.168.0.12 ether 5e:57:21:b5:c2:2e C vpn_vpn_nic
192.168.1.19 ether 00:d8:61:56:24:2d C eth1
172.16.0.1 ether 00:60:b9:7f:82:0f C eth0
桌面
$ ip a
1: lo: ~~~~~~~
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:d8:61:56:24:2d brd ff:ff:ff:ff:ff:ff
inet 192.168.1.19/24 brd 192.168.1.255 scope global noprefixroute eno1
valid_lft forever preferred_lft forever
inet6 fe80::2d8:61ff:fe56:242d/64 scope link
valid_lft forever preferred_lft forever
$ sudo ethtool eno1
Settings for eno1:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: on (auto)
Supports Wake-on: pumbg
Wake-on: d
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes
$ arp
Address HWtype HWaddress Flags Mask Iface
_gateway ether 04:ab:18:3b:af:e2 C eno1
拉斯皮(路由器)(当台式电脑切换时离开)
$ ip a
~~~~
4: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether 04:ab:18:3b:af:e2 brd ff:ff:ff:ff:ff:ff
~~~~
当台式电脑关闭时,eth1
与台式电脑的连接丢失。
$ arp
Address HWtype HWaddress Flags Mask Iface
172.16.0.91 ether 38:f9:d3:61:a4:2a C eth0
172.31.68.210 ether 00:ae:43:d1:c7:a2 C vpn_vpn_nic
192.168.0.12 ether 5e:57:21:b5:c2:2e C vpn_vpn_nic
172.16.0.1 ether 00:60:b9:7f:82:0f C eth0
局域网唤醒命令在拉斯皮。
wakeonlan -p 7 00:D8:61:56:24:2D
问题
我应该将桌面设置
eno1
为Wake-on: g
永久吗?难道是我的raspi路由错误?
为什么尽管广播(255.255.255.255)但魔包无法到达桌面?我找不到原因...
当台式电脑关闭时,Missing
eth1
inarp
command 是否正确?
回答(对于@telcoM的回答)
- 首先,我将桌面的以太网设置
eno1
为Wake-on: g
。为此,我使用了network manager
Ubuntu 18.04,因为我的台式电脑是 Ubuntu 18.04。
$ sudo vi /etc/netplan/~~~.yaml
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
ethernets:
eno1:
dhcp4: no
wakeonlan: true <<<<<<< Newly Added
addresses: [192.168.1.19/24]
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
其次,我将 BIOS
ErP
模式设置为禁用。然后,raspi(路由器)检测到
eth1
;
4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 04:ab:18:3b:af:e2 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.1/24 brd 192.168.1.255 scope global noprefixroute eth1
valid_lft forever preferred_lft forever
inet6 fe80::83fa:6dee:9799:9a6e/64 scope link
valid_lft forever preferred_lft forever
- 最后,执行以下命令即可唤醒电脑,之前的问题就彻底解决了!!!
wakeonlan -i 192.168.1.255 -p 7 00:D8:61:56:24:2D
答案1
当台式电脑关闭时,RasPi 连接到它的网络接口报告NO-CARRIER
,或者换句话说,物理链路断开。这意味着桌面未处于启用 LAN 唤醒的状态。
Wake-on: d
的输出证实ethtool
了这一点。d
表示“无任何唤醒”,因此 LAN 唤醒电路不会被激活。
是的,如果您想让它能够根据请求唤醒,您应该设置eno1
为。Wake-on: g
您可能还需要更改一两个 BIOS 设置,以确保系统固件允许系统唤醒。
如果您ErP
在 BIOS 设置中启用了兼容模式,则需要禁用它:ErP
基本上意味着系统将完全关闭,以最大限度地减少任何类型的待机功耗,并且通常会完全关闭 NIC,因此它不会能够接收 LAN 唤醒数据包。
您的 BIOS 设置可能还具有专用的 LAN 唤醒设置,或者更通用的名称,如“PCI 唤醒”。如果您的 BIOS 有类似的功能,您也应该启用它。这还有助于确保您的桌面在断电等情况后(而不是在 Linux 正确关闭后)返回到 WOL 就绪状态。
当桌面关闭并准备好 LAN 唤醒时,其 NIC 应保持部分活动状态 - 它很可能会降低链接速度以最大限度地减少功耗,但ip a
RasPi 上的 仍应报告UP
和LOWER_UP
上eth1
和ethtool eth1
上RasPi 应该说Link detected: yes
。
发送 LAN 唤醒数据包时,您可能必须将其定位到eth1
网络的广播地址,否则该wakeonlan
命令可能无法选择正确的接口来发送数据包:
wakeonlan -i 192.168.1.255 -p 7 00:D8:61:56:24:2D
答案2
只是一个基本的答案。不详细,因为我没做过。
为了使局域网唤醒工作,接收器的网卡必须保持打开状态(然后它不会丢失其载体):您首先需要检查您的硬件是否具有此功能,并且在固件中已启用它。然后在软件中启用。看https://wiki.debian.org/WakeOnLan