AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1325854
Accepted
Antonio Davila
Antonio Davila
Asked: 2021-03-25 09:37:45 +0800 CST2021-03-25 09:37:45 +0800 CST 2021-03-25 09:37:45 +0800 CST

网络连接激活失败 - 从 Windows 重新启动时修复

  • 772

我有 Windows 10 和 Ubuntu 20.14 的双启动。

从前一段时间,我的电脑出现问题......当它在 Ubuntu 中启动时,有时会随机启动(我的意思是,大约 30% 的初创公司会出现问题)说Activation of network connection failed,这是一台台式电脑,所以我使用以太网端口。

当问题出现时,在网络上尝试一些解决方案并不能解决问题。我试过了:

  • 此处建议重新启用有线连接
  • 重新启动所有路由器 - 我有 2 个,连接方式如下:[ISP 路由器] <LAN 端口 - WAN 端口> [Tplinkrouter] <LAN 端口 - Eth 端口> [PC]。此处建议的解决方案
  • 重新安装网络管理器并重新启动:sudo apt-get install --reinstall network-manager ; sudo reboot now这里也建议

此外,真正有趣的是,当我从 Windows 10 重新启动到 Ubuntu 时,问题消失了,如果我从 Ubuntu 重新启动到 Ubuntu,那么问题又出现了......

关于我的系统的一些上下文:

  • Windows 10 快速启动被禁用
  • 双引导在 nvme 驱动器上
  • 这个问题永远不会出现在 Windows 上
  • sudo lshw -C network输出(未出现问题时):
*-network                 
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:05:00.0
logical name: enp5s0
version: 0c
serial: b4:2e:99:e7:89:ea
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=5.8.0-48-generic duplex=full firmware=rtl8168g-2_0.0.1 02/06/13 ip=192.168.1.65 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
resources: irq:35 ioport:f000(size=256) memory:fcb00000-fcb00fff memory:f0300000-f0303fff

有什么办法可以解决这个恼人的失败?

提前致谢。

编辑1:

lspci -nn | grep -i ethernet输出:

05:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)

编辑2:

遵循@heynnema 解决方案:

步骤 1.将脚本“r8169_disable_msi”添加到/etc/initramfs-tools/scripts/init-top路径并chmod a+x对其执行以下操作:

要检查这里是否有ls -l /etc/initramfs-tools/scripts/init-top输出:

total 4
-rwxr-xr-x 1 root root 1118 mar 30 11:59 r8169_disable_msi

第 2 步。 “将 'r8169_disable_msi' 添加到内核命令行(/etc/default/grub, GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" 通常。)”所以我对 /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=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash r8169_disable_msi"
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
GRUB_GFXMODE=1920x1080

# 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"

步骤 3. sudo update-initramfs -c -k $(uname -r)输出:

update-initramfs: Generating /boot/initrd.img-5.8.0-48-generic
W: Possible missing firmware /lib/firmware/amdgpu/navi12_gpu_info.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_gpu_info.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_ta.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_asd.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_sos.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_ta.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_asd.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_sos.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_rlc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_mec2.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_mec.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_rlc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_mec2.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_mec.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_me.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_pfp.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_ce.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_sdma.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_sdma1.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_sdma.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_mes.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_dmcu.bin for module amdgpu
I: The initramfs will attempt to resume from /dev/nvme0n1p6
I: (UUID=64e37a0f-3360-471d-8c6d-02a5865d7e77)
I: Set the RESUME variable to override this.

步骤 4. sudo update-grub输出:

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.8.0-48-generic
Found initrd image: /boot/initrd.img-5.8.0-48-generic
Found linux image: /boot/vmlinuz-5.8.0-45-generic
Found initrd image: /boot/initrd.img-5.8.0-45-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings
done

这个解决方案奏效了。

networking
  • 1 1 个回答
  • 6808 Views

1 个回答

  • Voted
  1. Best Answer
    heynnema
    2021-03-25T11:15:34+08:002021-03-25T11:15:34+08:00

    链接速度

    您的以太网卡能够达到 1Gb 的速度,但只能以 100Mb 的速度使用。这通常表示电缆有问题,或者某些网络设备(如以太网集线器/交换机/路由器)无法提供 1G 速度。首先,检查您使用的是 5e 类或 6 类以太网电缆。

    sudo lshw -C network

    size: 100Mbit/s
    capacity: 1Gbit/s
    

    以太网驱动程序

    已知 r8169 驱动程序存在一些问题。安装此驱动程序,看看情况是否有所改善。

    sudo apt update
    
    sudo apt install dkms r8168-dkms
    
    reboot
    

    MSI中断问题

    一些 r816x 以太网卡不能正确处理 MSI/MSIX 中断。如果需要,我们可能需要实施补丁来解决该问题。需要时提供信息。给我看看:

    lspci -nn | grep -i ethernet
    

    05:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)
    

    这是所需的补丁。说明在脚本中。紧跟。

    # 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.) 
    
    # 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
    
    • 1

相关问题

  • 如何设置 VLAN 转发?

  • 如何将主机 Ubuntu 上的 VPN (tun0) 网络适配器映射到 VirtualBox 来宾 Windows?

  • 如何限制下载/上传带宽?

  • 如何通过 Windows 网络共享文件?

  • 面板小程序以文本形式显示当前网络流量?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve