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 / 问题 / 1517421
Accepted
john smith
john smith
Asked: 2024-06-13 04:29:54 +0800 CST2024-06-13 04:29:54 +0800 CST 2024-06-13 04:29:54 +0800 CST

网卡无法启动

  • 772

我的 Ubuntu 机器上有一块网卡无法启动(如链路断开、第 1 层问题)。驱动程序已加载,如下所示:

$ ethtool -i ens8
driver: r8169
version: 6.8.0-35-generic
firmware-version: rtl8168h-2_0.0.2 02/26/15
expansion-rom-version: 
bus-info: 0000:00:08.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: yes
supports-priv-flags: no

我尝试建立该链接,但发生了以下情况:它只是保持关闭状态。

$ sudo ip link set ens8 up
$ ip a | grep -A3 ens8
3: ens8: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 9c:53:22:48:71:63 brd ff:ff:ff:ff:ff:ff
    altname enp0s8

我检查 dmesg 和内核/驱动程序警报:

$ sudo dmesg -T | grep "ens8\|r8169"
[Wed Jun 12 21:13:19 2024] r8169 0000:00:08.0 eth0: RTL8168h/8111h, 9c:53:22:48:71:63, XID 541, IRQ 29
[Wed Jun 12 21:13:19 2024] r8169 0000:00:08.0 eth0: jumbo features [frames: 9194 bytes, tx checksumming: ko]
[Wed Jun 12 21:13:19 2024] r8169 0000:00:08.0 ens8: renamed from eth0
[Wed Jun 12 21:13:22 2024] Generic FE-GE Realtek PHY r8169-0-40:00: attached PHY driver (mii_bus:phy_addr=r8169-0-40:00, irq=MAC)
[Wed Jun 12 21:13:22 2024] r8169 0000:00:08.0 ens8: No native access to PCI extended config space, falling back to CSI
[Wed Jun 12 21:13:22 2024] r8169 0000:00:08.0 ens8: Link is Down

我看到上面写着“无法本机访问 PCI 扩展配置空间”,而谷歌对此没有明确的答案。我不知道该怎么做,我正在寻求帮助来解决这个问题。

我已经在网络管理器中创建了一个基本网络配置文件,专门为 ens8 提供动态 IP,但是当我尝试激活它时,出现以下信息:

$ nmcli con up PCINIC
Error: Connection activation failed: No suitable device found for this connection (device ens3 not available because profile is not compatible with device (mismatching interface name)).

我还在下面添加了这个配置文件(为简单起见,提供了一个简短的版本)以显示我使用的设置:

$ nmcli con show PCINIC 
connection.id:                          PCINIC
connection.type:                        802-3-ethernet
connection.interface-name:              ens8
connection.autoconnect:                 yes
connection.autoconnect-priority:        400
ipv4.method:                            auto

附注:这是一台使用 PCI 直通的虚拟机,用于主机中的 PCI 网卡。如果我将此 NIC 移入 Ubuntu 18.04 VM,它就可以正常工作。但是,在我使用 Ubuntu 24.04 LTS 安装新 VM 并将该 NIC 从旧 VM 移至新 VM 后,我似乎无法建立此链接。所以这不是 NIC 的故障,在我看来,这是与驱动程序相关的。

编辑:添加了一些 lspci 输出,以及手动设置速度双工:

$ lspci -knn | grep -A 5 00:08
00:08.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, r8168

我还尝试通过以下方式手动设置速度和双工:

$ nmcli con modify PCINIC 802-3-ethernet.auto-negotiate no 802-3-ethernet.speed 1000 802-3-ethernet.duplex full 
$ sudo systemctl restart NetworkManager.service
$ nmcli con up PCINIC
Error: Connection activation failed: No suitable device found for this connection (device ens3 not available because profile is not compatible with device (mismatching interface name)).
$ ip a | grep ens8
3: ens8: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000

现在将其设置回自动:

$ nmcli con modify PCINIC 802-3-ethernet.auto-negotiate yes
$ sudo systemctl restart NetworkManager.service 
$ nmcli con up PCINIC
Error: Connection activation failed: No suitable device found for this connection (device ens3 not available because profile is not compatible with device (mismatching interface name)).
$ ip a | grep ens8
3: ens8: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000

需要明确的是,这张卡在我仍在这台计算机上的 Ubuntu 18.04 vm 上运行良好,排除了连接到另一端的电缆和交换机。

networking
  • 1 1 个回答
  • 69 Views

1 个回答

  • Voted
  1. Best Answer
    john smith
    2024-06-18T03:53:21+08:002024-06-18T03:53:21+08:00

    我找到了自己帖子的答案,但为了防止大家遇到同样的麻烦,我还是向其他人提供了答案:

    我会尽力解释这一点,因为它令人困惑。我的主机 PC 上有 Qemu/虚拟机管理器。我创建了一个 Ubuntu VM,并在虚拟机管理器中为其分配了两个 PCI 插槽(即物理网卡);具体来说是 PCI 0000:09:00.0 和 PCI 0000:07:00.0。在 VM 主机上,这些适配器有以下映射:

    PCI 0000:09:00.0, Plugging cable in brings up enp6s0, and the NIC located physically at the bottom of my PC lights up
    PCI 0000:07:00.0, Plugging cable in brings up enp7s0, and the NIC located physically at the top of my PC lights up
    

    我现在从虚拟机管理器中主机上的此 Ubuntu VM 中删除 PCI 0000:07:00.0,并将其附加到另一台 VM,我们将其称为 VM2。当此设备启动时,映射将发生以下情况:

    PCI 0000:07:00.0, plugging cable into the top NIC does NOT bring up the port.  HOWEVER, if I plug this into the bottom NIC on my PC, the link light comes up, and my network interface comes up on the VM!
    

    有趣的是,当原始虚拟机启动时,它现在使用我 PC 中的顶部 NIC。所以就像物理映射改变了它一样。我不明白它为什么会这样做,但现在我可以让我的 NIC 工作了,因为我发现一旦从虚拟机中移除 NIC,就会将 PCI 插槽重新映射到另一张卡。所以这就是为什么插入电缆时端口没有出现的原因。

    • 0

相关问题

  • 如何设置 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