首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当设备在Linux中关闭,而不是在Windows中关闭时,WOL在停靠集线器上出现问题

当设备在Linux中关闭,而不是在Windows中关闭时,WOL在停靠集线器上出现问题
EN

Unix & Linux用户
提问于 2022-11-08 09:11:08
回答 1查看 66关注 0票数 0

我有一台戴尔笔记本电脑,它连接到戴尔的WD19TB码头。它可以双引导到Windows 10和Kubuntu22.04(20.04也存在这个问题)。

当我从Windows中关闭笔记本电脑时,我就可以发送一个WOL数据包到码头的NIC的MAC地址。当我从Kubuntu内部关闭笔记本电脑时,这是行不通的。

当我将网络电缆直接连接到笔记本而不是码头上时,当我将WOL数据包发送到笔记本电脑的NIC时,我可以在Kubuntu内部关闭它之后唤醒它。

这里有什么问题?

ethtool表示NIC设置正确,WOL处于活动状态。

代码语言:javascript
复制
ethtool enx<mac-address>
Settings for enx<mac-address>:
    Supported ports: [ TP    MII ]
    Supported link modes:   10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Half 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
    Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                         100baseT/Half 100baseT/Full
                                         1000baseT/Full
    Link partner advertised pause frame use: No
    Link partner advertised auto-negotiation: Yes
    Link partner advertised FEC modes: Not reported
    Speed: 1000Mb/s
    Duplex: Full
    Auto-negotiation: on
    Port: MII
    PHYAD: 32
    Transceiver: internal
    Supports Wake-on: pumbg
    Wake-on: g
        Current message level: 0x00007fff (32767)
                               drv probe link timer ifdown ifup
                               rx_err tx_err tx_queued intr
                               tx_done rx_status pktdata hw wol
    Link detected: yes

lshw -class network打印

代码语言:javascript
复制
description: Ethernet interface
physical id: 14
bus info: usb@4:2.4
logical name: enx<mac-address>
serial: <mac-address>
size: 1Gbit/s
capacity: 1Gbit/s
capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8152 driverversion=v1.12.13 duplex=full firmware=rtl8153b-2 v1 10/23/19 link=yes multicast=yes port=MII speed=1Gbit/s

码头是通过雷电连接的。也许Windows正在把码头放到某种待机模式中,而Kubuntu却在关闭它?

同样的问题,当让笔记本睡觉,它将不会醒来与WOL。

EN

回答 1

Unix & Linux用户

发布于 2022-11-13 01:45:11

默认情况下,有些网络接口没有设置WOL标志。您可以使用ethtool进行更改(可以使用apt install ethtool安装)。

若要检查是否设置了WOL标志,请使用:

代码语言:javascript
复制
ethtool <nic> | grep Wake

输出应该是这样的:

代码语言:javascript
复制
    Supports Wake-on: pumbg
    Wake-on: g

如果上面写着Wake-on: d,那就意味着局域网上的唤醒是禁用的。启用了g。您可以通过键入以下命令手动设置此标志:

代码语言:javascript
复制
ethtool -s <nic> wol g

您可以设置网络接口,以便在每次系统通过编辑/etc/network/interfaces启动时启用此功能。

代码语言:javascript
复制
auto <nic>
iface <nic> ...
        ...
        up ethtool -s <nic> wol g

也许有一种更现代的方法来做这件事,但我已经使用这个设置多年了。有更多信息的Debian文章

票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/724083

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档