如何关闭以太网卡上的“节能以太网”?

如何关闭以太网卡上的“节能以太网”?

我最近换到了 Ubuntu 22.04。在此之前,我使用的是 Windows 10。我不得不购买新的以太网卡(TP-Link TG-3468),因为我的主板以太网端口停止工作。使用以太网卡时,以太网不断断开连接。经过一番谷歌搜索,我在 Windows 上禁用了“节能以太网”。该屏幕截图并未描绘 Windows 10,但看起来是一样的。我现在在 Ubuntu 上遇到了同样的问题,我想问一下在哪里可以禁用以太网卡的相同设置,但在 Ubuntu 22.04 上

输出cat /etc/default/grub

If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

    GRUB_DEFAULT=0
    GRUB_TIMEOUT_STYLE=hidden
    GRUB_TIMEOUT=0
    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash igb.EEE=0"
    GRUB_CMDLINE_LINUX=""
    
    # Uncomment to enable BadRAM filtering, modify to suit your needs
    # This works with Linux (no patch required) and with any kernel that obtains
    # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
    #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
    
    # Uncomment to disable graphical terminal (grub-pc only)
    #GRUB_TERMINAL=console
    
    # The resolution used on graphical terminal
    # note that you can use only modes which your graphic card supports via VBE
    # you can see them in real GRUB with the command `vbeinfo'
    #GRUB_GFXMODE=640x480
    
    # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
    #GRUB_DISABLE_LINUX_UUID=true
    
    # Uncomment to disable generation of recovery mode menu entries
    #GRUB_DISABLE_RECOVERY="true"
    
    # Uncomment to get a beep at grub start
    #GRUB_INIT_TUNE="480 440 1"

输出ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 5c:a6:e6:54:e3:c9 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.109/24 brd 192.168.1.255 scope global dynamic noprefixroute enp6s0
       valid_lft 85874sec preferred_lft 85874sec
    inet6 2a02:120b:7f5:cab0:59b5:41c3:736a:687a/64 scope global temporary dynamic 
       valid_lft 86384sec preferred_lft 14384sec
    inet6 2a02:120b:7f5:cab0:7a76:9c37:2714:87c/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 86384sec preferred_lft 14384sec
    inet6 fe80::a39f:468f:9437:b5a7/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

输出lspci -nnk | grep 0200 -A3

06:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8161] (rev 15)
    Subsystem: Realtek Semiconductor Co., Ltd. TP-Link TG-3468 v4.0 Gigabit PCI Express Network Adapter [10ec:8168]
    Kernel driver in use: r8169
    Kernel modules: r8169

答案1

您可以在内核参数中禁用节能以太网。

跑步

sudo nano /etc/default/grub

并改变

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash igb.EEE=0"

保存文件并运行

sudo update-grub

笔记:此设置对您不起作用,因为 的第一行有误/etc/default/grub。您不小心#从开头删除了 。

If you change this file, run 'update-grub' afterwards to update

应该

# If you change this file, run 'update-grub' afterwards to update

这应该禁用该功能重启后

您可以通过以下方式检查状态

ethtool --show-eee enp6s0

您也可以使用 禁用 EEE ethtool,但重启后它不会保留。

ethtool --set-eee enp6s0 eee off

答案2

我相信您的设备的备用驱动程序 r8168 具有 eee_enable 作为可操作参数。让我们安装它,看看它是否有帮助。

sudo -i
apt update
apt install -y r8168-dkms
echo “options r8168 eee_enable=0”  >  /etc/modprobe.d/r8168.conf
exit

重启。有什么改善吗?

相关内容