网络唤醒:路由器问题

网络唤醒:路由器问题

我正在尝试让局域网唤醒功能工作。一切都按需要配置,如果我关闭计算机并在几分钟内唤醒它,它就会工作。据我了解,这是一个路由器问题,路由器似乎忘记了 mac 地址并停止转发魔术包。是否有任何可能强制路由器不要忘记到计算机的路由?(我确实查看了路由器,但我找不到可能与问题相关的任何其他选项。这是一个记录不全的 Sagemcom 光纤路由器。)

Ubuntu 20.04

uname -r

5.11.0-34-generic

sudo lshw -C 网络

*-network                 
       Beschreibung: Ethernet interface
       Produkt: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       Hersteller: Realtek Semiconductor Co., Ltd.
       Physische ID: 0
       Bus-Informationen: pci@0000:03:00.0
       Logischer Name: enp3s0
       Version: 0c
       Seriennummer: bc:ee:7b:8a:6e:f9
       Größe: 1Gbit/s
       Kapazität: 1Gbit/s
       Breite: 64 bits
       Takt: 33MHz
       Fähigkeiten: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       Konfiguration: autonegotiation=on broadcast=yes driver=r8169 driverversion=5.11.0-34-generic duplex=full firmware=rtl8168g-2_0.0.1 02/06/13 ip=192.168.1.22 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       Ressourcen: irq:18 ioport:e000(Größe=256) memory:f7c00000-f7c00fff memory:f0000000-f0003fff
~$ dkms status
r8168, 8.048.00, 5.11.0-34-generic, x86_64: installed
~$ ls -al /boot
insgesamt 201001
drwxr-xr-x  5 root root     4096 Sep 14 06:14 .
drwxr-xr-x 20 root root     4096 Mai  4  2020 ..
-rw-r--r--  1 root root   253507 Aug 27 09:43 config-5.11.0-34-generic
drwx------  4 root root      512 Jan  1  1970 efi
drwxr-xr-x  4 root root     4096 Sep 13 20:17 grub
lrwxrwxrwx  1 root root       28 Sep  9 08:39 initrd.img -> initrd.img-5.11.0-34-generic
-rw-------  1 root root 94605589 Sep 14 06:14 initrd.img-5.11.0-34-generic
-rw-------  1 root root 94392894 Sep 14 06:13 initrd.img-5.11.0-34-generic.old-dkms
lrwxrwxrwx  1 root root       28 Sep 13 20:17 initrd.img.old -> initrd.img-5.11.0-34-generic
drwx------  2 root root    16384 Mai  4  2020 lost+found
-rw-r--r--  1 root root   182704 Aug 18  2020 memtest86+.bin
-rw-r--r--  1 root root   184380 Aug 18  2020 memtest86+.elf
-rw-r--r--  1 root root   184884 Aug 18  2020 memtest86+_multiboot.bin
-rw-------  1 root root  5836236 Aug 27 09:43 System.map-5.11.0-34-generic
lrwxrwxrwx  1 root root       25 Sep  9 08:39 vmlinuz -> vmlinuz-5.11.0-34-generic
-rw-------  1 root root 10132256 Aug 27 09:48 vmlinuz-5.11.0-34-generic
lrwxrwxrwx  1 root root       25 Sep 13 20:17 vmlinuz.old -> vmlinuz-5.11.0-34-generic

答案1

这些应该可以解决问题。只需一次,然后重新测试。

  1. r8168-dkms

尝试用此驱动程序替换 r8169 驱动程序...

sudo apt update

sudo apt install dkms r8168-dkms

reboot

  1. 睡眠呼吸暂停

打开terminal

nm-connection-editor

检查这些设置...

在此处输入图片描述

  1. 微星

Ubuntu 20.xx 中某些以太网卡启用了 MSI/MSIX 中断。这可能会导致以太网运行不顺畅。这里有一个补丁可以修复它。按照嵌入的说明进行安装。

#!/bin/sh

# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1779817

# filename: r8169_disable_msi

# Drop it in /etc/initramfs-tools/scripts/init-top and chmod a+x it. Add 'r8169_disable_msi'
# to your kernel command line (/etc/default/grub, GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
# usually.) 

# sudo -H gedit /etc/default/grub # to edit the file

# Remember to update-initramfs and update-grub as necessary.

# sudo update-initramfs -c -k $(uname -r)
# sudo update-grub
# reboot

# For the moment it disables MSI on everything with the ID 0x10ec:0x8168, as there seems to
# be no way to get the MAC version from userspace - and certainly not before the driver is
# loaded. Other PCI IDs may need adding..

PREREQ=""
prereqs()
{
    echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
    prereqs
    exit 0
    ;;
esac

disable_msi () {
    for i in /sys/bus/pci/devices/*; do 
        if [ $(cat $i/vendor) = "0x10ec" -a $(cat $i/device) = "0x8168" ]; then
            echo 0 >$i/msi_bus
        fi
    done
}

for x in $(cat /proc/cmdline); do
        case ${x} in
        r8169_disable_msi)
        disable_msi
        break
                ;;
        esac
done

相关内容