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
    • 最新
    • 标签
主页 / server / 问题 / 636621
Accepted
Dmitry Minkovsky
Dmitry Minkovsky
Asked: 2014-10-14 06:13:40 +0800 CST2014-10-14 06:13:40 +0800 CST 2014-10-14 06:13:40 +0800 CST

为什么我的 eth0 叫 eno16777736?

  • 772

我看过http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/,它描述了一致/可预测设备命名的基本原理,然后是生成设备名称的规则:

 * Two character prefixes based on the type of interface:
 *   en -- ethernet
 *   sl -- serial line IP (slip)
 *   wl -- wlan
 *   ww -- wwan
 *
 * Type of names:
 *   b<number>                             -- BCMA bus core number
 *   ccw<name>                             -- CCW bus group name
 *   o<index>                              -- on-board device index number
 *   s<slot>[f<function>][d<dev_port>]     -- hotplug slot index number
 *   x<MAC>                                -- MAC address
 *   [P<domain>]p<bus>s<slot>[f<function>][d<dev_port>]
 *                                         -- PCI geographical location
 *   [P<domain>]p<bus>s<slot>[f<function>][u<port>][..][c<config>][i<interface>]
 *                                         -- USB port number chain

所以假设我有设备eno16777736:为什么叫它?这是一张以太网卡,我知道了。但是我怎样才能自己回到这个接口的其余部分呢?

我检查/sys/class/net/eno16777736并看到:

eno16777736 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:01.0/net/eno16777736

也不知道如何解释这一点,或者我是否可以使用这些信息来获取eno16777736.

更新

所以16777736是设备的acpi_index. 根据https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-bus-pci:

What:       /sys/bus/pci/devices/.../acpi_index
Date:       July 2010
Contact:    Narendra K <[email protected]>, [email protected]
Description:
        Reading this attribute will provide the firmware
        given instance (ACPI _DSM instance number) of the PCI device.
        The attribute will be created only if the firmware has given
        an instance number to the PCI device. ACPI _DSM instance number
        will be given priority if the system firmware provides SMBIOS
        type 41 device type instance also.

而且,确实:

core@localhost /sys/devices/pci0000:00/0000:00:11.0/0000:02:01.0 $ find . -type f | xargs grep 1677 2> /dev/null
./net/eno16777736/uevent:INTERFACE=eno16777736
./acpi_index:16777736

此外,要协调来自ifconfigorip link和您的设备的输出lspci:

$ ifconfig
eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.0.37  netmask 255.255.255.0  broadcast 10.0.0.255
        inet6 fe80::20c:29ff:fe70:c039  prefixlen 64  scopeid 0x20<link>
        inet6 2601:a:7c0:66:20c:29ff:fe70:c039  prefixlen 64  scopeid 0x0<global>
        ether 00:0c:29:70:c0:39  txqueuelen 1000  (Ethernet)
        RX packets 326  bytes 37358 (36.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 172  bytes 45999 (44.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 19  base 0x2000 

注意“设备中断 19”。从lspci -v,其中有“IRQ 19”:

02:01.0 Ethernet controller: Advanced Micro Devices, Inc. [AMD] 79c970 [PCnet32 LANCE] (rev 10)
        Subsystem: Advanced Micro Devices, Inc. [AMD] PCnet - Fast 79C971
        Physical Slot: 33
        Flags: bus master, medium devsel, latency 64, IRQ 19
        I/O ports at 2000 [size=128]
        [virtual] Expansion ROM at fd500000 [disabled] [size=64K]
        Kernel driver in use: pcnet32

在这里您还可以看到“物理插槽 33”,实际上,有时 VMWare 会引导ens33作为接口名称获取的 VM。因此,不清楚为什么其他时候它选择 eno16777736。但是 16777736 来自acpi_index, 33 来自 PCI 插槽。

linux
  • 2 2 个回答
  • 21930 Views

2 个回答

  • Voted
  1. Best Answer
    garethTheRed
    2014-10-14T06:31:33+08:002014-10-14T06:31:33+08:00

    en用于以太网

    o机载

    16777736是固件 (BIOS/EFI) 提供的设备索引。从 开始索引是合乎逻辑的1。要么,要么您拥有合理的固件和超过 1600 万个板载设备!但更有可能的是,您在VMware 社区上看到了提出的问题(但未得到答复)- 该数字似乎来自acpi_index.

    您可以通过以下方式查看系统的类似信息udev:

    udevadm info --name=/dev/eno16777736 --attribute-walk
    
    • 30
  2. Gene
    2014-10-14T06:22:43+08:002014-10-14T06:22:43+08:00

    使用 VMware?

    Unix Stackexchange 站点对此有一个问答。BIOS 似乎正在提供有关 NIC 的信息。

    如果您想将其更改为eth0(或其他名称),您可以使用 udev 来执行此操作。 这是一个方便的指南。

    • 9

相关问题

  • Linux 主机到主机迁移

  • 如何在 Linux 机器上找到有关硬件的详细信息?

  • 如何在 Linux 下监控每个进程的网络 I/O 使用情况?

  • 在 RHEL4 上修改 CUPS 中的现有打印机设置

  • 为本地网络中的名称解析添加自定义 dns 条目

Sidebar

Stats

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

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve