Nic*_*ich 114 linux networking udev ethernet
当我运行时ifconfig -a,我只得到lo和enp0s10接口,而不是经典的eth0
enp0s10是什么意思?为什么没有eth0?
DIG*_*mbl 161
回答“enp0s10 是什么意思?” 题:
enp0s10:
| | |
v | |
en| | --> ethernet
v |
p0| --> bus number (0)
v
s10 --> slot number (10)
Run Code Online (Sandbox Code Playgroud)
来源:GitHub 上的 udev-builtin-net_id.c
Bra*_*iam 96
现在 udevd 为以太网设备分配名称的方式发生了变化。现在您的设备使用“可预测的接口名称”,它基于(并引用来源):
- 包含固件/BIOS 的名称为板载设备提供索引号(例如:eno1)
- 包含固件/BIOS 提供的 PCI Express 热插拔插槽索引号的名称(例如:ens1)
- 包含硬件连接器物理/地理位置的名称(例如:enp2s0)
- 包含接口 MAC 地址的名称(例如:enx78e7d1ea46da)
- 经典的、不可预测的内核原生 ethX 命名(例如:eth0)
更改的原因记录在systemd freedesktop.org 页面中,以及禁用此功能的方法:
ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
Run Code Online (Sandbox Code Playgroud)
或者如果您使用旧版本:
ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules
Run Code Online (Sandbox Code Playgroud)
小智 27
如上所述,enp0s10 指的是以太网(en),前缀 0(p0),插槽 10(s10)。总线编号、设备编号和功能编号从 PCI 设备的总线设备功能 (BDF) 中提取,以创建可预测网络接口名称的前缀、插槽和功能部分。
如果函数为 0,则省略 f0 部分。在本例中,为了清楚起见,我将前缀从 p0 更改为 p4,并将函数从 f0 更改为 f1。
enp4s10f1 pci 0000:04:0a.1
| | | | | | | |
| | | | domain <- 0000 | | |
| | | | | | |
en| | | --> ethernet | | |
| | | | | |
p4| | --> prefix/bus number (4) <-- 04 | |
| | | |
s10| --> slot/device number (10) <-- 10 |
| |
f1 --> function number (1) <-- 1
Run Code Online (Sandbox Code Playgroud)
https://wiki.xen.org/wiki/Bus:Device.Function_(BDF)_Notation https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames
我最后遇到了一个带有 u7 的设备,用于 USB 端口。本文档中包含有关可预测网络接口设备名称的一些不同标签可能性。