【Ubuntu20.04】多个网口,每次启动网口的名称不固定

包含网卡/无线网的网络问题和ADSL/校园网/宽带拨号支持及代理/共享等网络使用问题
回复
rrhy
帖子: 10
注册时间: 2023-03-02 14:12
系统: ubuntu20.04

【Ubuntu20.04】多个网口,每次启动网口的名称不固定

#1

帖子 rrhy » 2023-03-02 14:33

一、问题
发现物理网口比较多的情况下,每次启动系统物理网口对应的网卡名称不固定。由于我们设备会有几十台,物理网口会配置固定IP,如果物理网口对应的名称一直变化,则无法实现配置。使用的Ubuntu版本是20.04 LTS 版本。

代码: 全选

----|-- 第一次------------|---第二次------------|---第三次------------|---第四次
eth0|   00:30:64:35:48:e6|   00:30:64:34:92:e6|   00:30:64:35:48:e6|   00:30:64:35:48:e6
eth1|   00:30:64:35:48:e7|   00:30:64:35:48:e6|   00:30:64:34:92:e6|   00:30:64:35:48:e7
eth2|   00:30:64:34:92:e6|   00:30:64:35:48:e7|   00:30:64:35:48:e7|   00:30:64:34:92:e6
eth3|   00:c0:3a:ae:61:8f|   00:c0:3a:ae:61:8f|   00:c0:3a:ae:61:8f|   00:c0:3a:ae:61:8f
eth4|   00:c0:3a:ae:63:8f|   00:30:64:34:92:e7|   00:c0:3a:ae:63:8f|   00:c0:3a:ae:63:8f
eth5|   00:c0:3a:ae:65:8f|   00:c0:3a:ae:63:8f|   00:c0:3a:ae:65:8f|   00:c0:3a:ae:65:8f
eth6|   00:30:64:34:92:e7|   00:c0:3a:ae:65:8f|   00:30:64:34:92:e7|   00:c0:3a:ae:67:8f
eth7|   00:c0:3a:ae:67:8f|   00:c0:3a:ae:67:8f|   00:c0:3a:ae:67:8f|   00:30:64:34:92:e7

二、例子
安装Ubuntu20.04LTS系统的设备有6个物理网口,第一个物理网口这次开机是enp16s0,下一次开机可能变成了enp2s0。

三、之前版本的解决方案
以前使用Ubuntu14.04LTS时,可以通过
>lspci | grep Eth
查询到的设备号,在/etc/udev/rules.d/70-persistent-net.rules中增加如下内容,可以将设备号与网卡名称进行绑定,并且每次启动物理网口对应的名称就都不会改变了。
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",KERNELS=="0000:08:00.0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"


四、Ubuntu20.04LTS的尝试
但是到了Ubuntu20.04LTS之后,/etc/udev/rules.d/70-persistent-net.rules不再起作用,尝试了将网口变更为eth0. eth1...也同样会出现当次开机为eth2,下次开机为eth4的情况。

/etc/udev/rules.d/70-persistent-net.rules
用下面两种方式绑定,均无效。但是这两种方式在Ubuntu14.04均有效。

代码: 全选

SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",KERNELS=="0000:02:00.0",ATTR{type}=="1",KERNEL=="eth*",NAME="eth0"
SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",KERNELS=="0000:01:00.0",ATTR{type}=="1",KERNEL=="eth*",NAME="eth1"
SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",KERNELS=="0000:10:00.0",ATTR{type}=="1",KERNEL=="eth*",NAME="eth2"
SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",KERNELS=="0000:11:00.0",ATTR{type}=="1",KERNEL=="eth*",NAME="eth3"
SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",KERNELS=="0000:13:00.0",ATTR{type}=="1",KERNEL=="eth*",NAME="eth4"
SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",KERNELS=="0000:15:00.0",ATTR{type}=="1",KERNEL=="eth*",NAME="eth5"
SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",KERNELS=="0000:1a:00.0",ATTR{type}=="1",KERNEL=="eth*",NAME="eth6"
SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",KERNELS=="0000:19:00.0",ATTR{type}=="1",KERNEL=="eth*",NAME="eth7"

代码: 全选

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:30:64:35:48:e6", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:30:64:35:48:e7", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:30:64:34:92:e6", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:c0:3a:ae:61:8f", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:c0:3a:ae:63:8f", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:c0:3a:ae:65:8f", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:30:64:34:92:e7", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth6"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:c0:3a:ae:67:8f", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth7"
变更为eth0. eth1...的方法是在/etc/default/grub中GRUB_CMDLINE_LINUX增加net.ifnames=0 biosdevname=0,然后使用命令update-grub更新后,重新开机启动。
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 acpi_enforce_resources=lax text"

使用netplan的yaml绑定mac地址的方式不可取,因为每个机器的mac地址都不一样,要实现多个机器都能用,目前只发现了lspci中的设备号绑定能够唯一固定网口名称


请教各位大神有没有遇到过这个问题的,求教 :What
头像
astolia
论坛版主
帖子: 6454
注册时间: 2008-09-18 13:11

Re: 【Ubuntu20.04】多个网口,每次启动网口的名称不固定

#2

帖子 astolia » 2023-03-02 21:30

代码: 全选

udevadm info -a /sys/class/net/接口名
去看每一层级各个参数的值是什么,和你写的对得上不
rrhy
帖子: 10
注册时间: 2023-03-02 14:12
系统: ubuntu20.04

Re: 【Ubuntu20.04】多个网口,每次启动网口的名称不固定

#3

帖子 rrhy » 2023-03-03 8:54

astolia 写了: 2023-03-02 21:30

代码: 全选

udevadm info -a /sys/class/net/接口名
去看每一层级各个参数的值是什么,和你写的对得上不
我在第一次登录的时候查询之后设置的,然后设置好的。但是第二次开机,第三次开机就不一样了。没有达到固定网口名称的目的。
头像
astolia
论坛版主
帖子: 6454
注册时间: 2008-09-18 13:11

Re: 【Ubuntu20.04】多个网口,每次启动网口的名称不固定

#4

帖子 astolia » 2023-03-03 9:58

rrhy 写了: 2023-03-03 8:54
astolia 写了: 2023-03-02 21:30

代码: 全选

udevadm info -a /sys/class/net/接口名
去看每一层级各个参数的值是什么,和你写的对得上不
我在第一次登录的时候查询之后设置的,然后设置好的。但是第二次开机,第三次开机就不一样了。没有达到固定网口名称的目的。
你把你查询到的内容贴上来看看?
rrhy
帖子: 10
注册时间: 2023-03-02 14:12
系统: ubuntu20.04

Re: 【Ubuntu20.04】多个网口,每次启动网口的名称不固定

#5

帖子 rrhy » 2023-03-03 10:07

astolia 写了: 2023-03-03 9:58
rrhy 写了: 2023-03-03 8:54
astolia 写了: 2023-03-02 21:30

代码: 全选

udevadm info -a /sys/class/net/接口名
去看每一层级各个参数的值是什么,和你写的对得上不
我在第一次登录的时候查询之后设置的,然后设置好的。但是第二次开机,第三次开机就不一样了。没有达到固定网口名称的目的。
你把你查询到的内容贴上来看看?
udevadm info -a /sys/class/net/eth0

代码: 全选

 looking at device '/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/net/eth0':
    KERNEL=="eth0"
    SUBSYSTEM=="net"
    DRIVER==""
    ATTR{addr_assign_type}=="0"
    ATTR{dev_id}=="0x0"
    ATTR{speed}=="-1"
    ATTR{dev_port}=="0"
    ATTR{iflink}=="2"
    ATTR{proto_down}=="0"
    ATTR{netdev_group}=="0"
    ATTR{flags}=="0x1003"
    ATTR{broadcast}=="ff:ff:ff:ff:ff:ff"
    ATTR{operstate}=="down"
    ATTR{type}=="1"
    ATTR{addr_len}=="6"
    ATTR{dormant}=="0"
    ATTR{link_mode}=="0"
    ATTR{napi_defer_hard_irqs}=="0"
    ATTR{testing}=="0"
    ATTR{carrier_down_count}=="1"
    ATTR{address}=="00:30:64:35:48:e6"
    ATTR{mtu}=="1500"
    ATTR{gro_flush_timeout}=="0"
    ATTR{carrier_changes}=="1"
    ATTR{ifindex}=="2"
    ATTR{carrier_up_count}=="0"
    ATTR{duplex}=="unknown"
    ATTR{ifalias}==""
    ATTR{carrier}=="0"
    ATTR{tx_queue_len}=="1000"
    ATTR{threaded}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:1c.0/0000:01:00.0':
    KERNELS=="0000:01:00.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="igb"
    ATTRS{ari_enabled}=="0"
    ATTRS{driver_override}=="(null)"
    ATTRS{device}=="0x1533"
    ATTRS{subsystem_vendor}=="0xffff"
    ATTRS{local_cpulist}=="0-3"
    ATTRS{power_state}=="D0"
    ATTRS{reset_method}=="flr bus"
    ATTRS{max_link_speed}=="2.5 GT/s PCIe"
    ATTRS{msi_bus}=="1"
    ATTRS{numa_node}=="-1"
    ATTRS{class}=="0x020000"
    ATTRS{dma_mask_bits}=="64"
    ATTRS{consistent_dma_mask_bits}=="64"
    ATTRS{irq}=="16"
    ATTRS{broken_parity_status}=="0"
    ATTRS{max_link_width}=="1"
    ATTRS{local_cpus}=="f"
    ATTRS{revision}=="0x03"
    ATTRS{enable}=="1"
    ATTRS{current_link_width}=="1"
    ATTRS{vendor}=="0x8086"
    ATTRS{subsystem_device}=="0x0000"
    ATTRS{d3cold_allowed}=="1"
    ATTRS{current_link_speed}=="2.5 GT/s PCIe"

  looking at parent device '/devices/pci0000:00/0000:00:1c.0':
    KERNELS=="0000:00:1c.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="pcieport"
    ATTRS{local_cpulist}=="0-3"
    ATTRS{current_link_speed}=="2.5 GT/s PCIe"
    ATTRS{driver_override}=="(null)"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{power_state}=="D0"
    ATTRS{ari_enabled}=="0"
    ATTRS{secondary_bus_number}=="1"
    ATTRS{vendor}=="0x8086"
    ATTRS{enable}=="1"
    ATTRS{class}=="0x060400"
    ATTRS{max_link_speed}=="5.0 GT/s PCIe"
    ATTRS{revision}=="0x11"
    ATTRS{local_cpus}=="f"
    ATTRS{d3cold_allowed}=="1"
    ATTRS{subsystem_device}=="0x0f48"
    ATTRS{current_link_width}=="1"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{subordinate_bus_number}=="1"
    ATTRS{irq}=="87"
    ATTRS{reset_method}=="pm"
    ATTRS{broken_parity_status}=="0"
    ATTRS{max_link_width}=="1"
    ATTRS{subsystem_vendor}=="0x8086"
    ATTRS{numa_node}=="-1"
    ATTRS{msi_bus}=="1"
    ATTRS{device}=="0x0f48"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""
    ATTRS{waiting_for_supplier}=="0"
头像
astolia
论坛版主
帖子: 6454
注册时间: 2008-09-18 13:11

Re: 【Ubuntu20.04】多个网口,每次启动网口的名称不固定

#6

帖子 astolia » 2023-03-03 11:27

我到虚拟机上跑20.04测试了一下,用你写的规则改名是没问题的。
你改下/etc/udev/udev.conf,把udev_log设成debug,再用update-initramfs重建initrd,重启后journalctl -b 0 | grep udevd看看udev的日志中规则有没有被正确解析以及应用
rrhy
帖子: 10
注册时间: 2023-03-02 14:12
系统: ubuntu20.04

Re: 【Ubuntu20.04】多个网口,每次启动网口的名称不固定

#7

帖子 rrhy » 2023-03-03 15:07

astolia 写了: 2023-03-03 11:27 我到虚拟机上跑20.04测试了一下,用你写的规则改名是没问题的。
你改下/etc/udev/udev.conf,把udev_log设成debug,再用update-initramfs重建initrd,重启后journalctl -b 0 | grep udevd看看udev的日志中规则有没有被正确解析以及应用
---日志里只有eth0和eth1,其他几个口搜索不到

---日志信息太多,字数有限制,只截取了部分。不知道这些内容能不能看出问题 :Sad

代码: 全选

eth0: /etc/udev/rules.d/70-persistent-net.rules:9 NAME 'eth0'
eth0: /usr/lib/udev/rules.d/75-net-description.rules:6 Importing properties from results of builtin command 'net_id'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
Using default interface naming scheme 'v245'.
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
0000:00:1c.0:pcie010: Device (SEQNUM=2852, ACTION=add) processed
0000:00:1c.0:pcie010: sd-device-monitor: Passed 185 byte to netlink monitor
0000:04:0e.0: /usr/lib/udev/rules.d/80-drivers.rules:5 RUN 'kmod load $env{MODALIAS}'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
0000:04:0e.0: sd-device: Created db file '/run/udev/data/+pci:0000:04:0e.0' for '/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/0000:04:0e.0'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
0000:04:0e.0: Running built-in command "kmod load pci:v00001033d00000035sv00001033sd00000035bc0Csc03i10"
0000:00:1f.0: /usr/lib/udev/rules.d/50-udev-default.rules:14 Importing properties from results of builtin command 'hwdb --subsystem=pci'
Loading module: pci:v00001033d00000035sv00001033sd00000035bc0Csc03i10
Failed to find module 'pci:v00001033d00000035sv00001033sd00000035bc0Csc03i10'
0000:04:0e.0: Device (SEQNUM=2868, ACTION=add) processed
0000:04:0e.0: sd-device-monitor: Passed 575 byte to netlink monitor
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
Fixed MDIO bus.0: /usr/lib/udev/rules.d/50-udev-default.rules:14 Importing properties from results of builtin command 'hwdb --subsystem=platform'
Fixed MDIO bus.0: No entry found from hwdb.
Fixed MDIO bus.0: /usr/lib/udev/rules.d/50-udev-default.rules:14 Failed to run builtin 'hwdb --subsystem=platform': No data available
Fixed MDIO bus.0: /usr/lib/udev/rules.d/60-drm.rules:3 Importing properties from results of builtin command 'path_id'
event0: /usr/lib/udev/rules.d/64-xorg-xkb.rules:6 Importing properties from '/etc/default/keyboard'
Fixed MDIO bus.0: /usr/lib/udev/rules.d/80-drivers.rules:5 RUN 'kmod load $env{MODALIAS}'
Fixed MDIO bus.0: sd-device: Created db file '/run/udev/data/+platform:Fixed MDIO bus.0' for '/devices/platform/Fixed MDIO bus.0'
Fixed MDIO bus.0: Running built-in command "kmod load platform:Fixed MDIO bus"
Loading module: platform:Fixed
Failed to find module 'platform:Fixed'
Loading module: MDIO
Failed to find module 'MDIO'
Loading module: bus
Failed to find module 'bus'
Fixed MDIO bus.0: Device (SEQNUM=2946, ACTION=add) processed
Fixed MDIO bus.0: sd-device-monitor: Passed 268 byte to netlink monitor
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
event0: /usr/lib/udev/rules.d/80-libinput-device-groups.rules:4 Importing properties from results of 'libinput-device-group /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0/event0'
0000:02:00.0: /usr/lib/udev/rules.d/50-udev-default.rules:14 Importing properties from results of builtin command 'hwdb --subsystem=pci'
event0: Starting 'libinput-device-group /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0/event0'
Successfully forked off '(spawn)' as PID 324.
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
0000:02:00.0: /usr/lib/udev/rules.d/80-drivers.rules:5 RUN 'kmod load $env{MODALIAS}'
0000:02:00.0: sd-device: Created db file '/run/udev/data/+pci:0000:02:00.0' for '/devices/pci0000:00/0000:00:1c.1/0000:02:00.0'
0000:02:00.0: Running built-in command "kmod load pci:v00008086d00001533sv0000FFFFsd00000000bc02sc00i00"
Loading module: pci:v00008086d00001533sv0000FFFFsd00000000bc02sc00i00
Module 'igb' is already loaded
0000:02:00.0: Device (SEQNUM=2860, ACTION=add) processed
0000:02:00.0: sd-device-monitor: Passed 520 byte to netlink monitor
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
wakeup30: Device (SEQNUM=2856, ACTION=add) processed
wakeup30: sd-device-monitor: Passed 188 byte to netlink monitor
0000:00:1f.0: /usr/lib/udev/rules.d/80-drivers.rules:5 RUN 'kmod load $env{MODALIAS}'
0000:00:1f.0: sd-device: Created db file '/run/udev/data/+pci:0000:00:1f.0' for '/devices/pci0000:00/0000:00:1f.0'
0000:00:1f.0: Running built-in command "kmod load pci:v00008086d00000F1Csv00008086sd00000F1Cbc06sc01i00"
Loading module: pci:v00008086d00000F1Csv00008086sd00000F1Cbc06sc01i00
Module 'lpc_ich' is already loaded
0000:00:1f.0: Device (SEQNUM=2935, ACTION=add) processed
0000:00:1f.0: sd-device-monitor: Passed 513 byte to netlink monitor
usb4: Handling device node '/dev/bus/usb/004/001', devnum=c189:384
usb4: Preserve permissions of /dev/bus/usb/004/001, uid=0, gid=0, mode=0664
usb4: Preserve already existing symlink '/dev/char/189:384' to '../bus/usb/004/001'
0000:02: Device (SEQNUM=2864, ACTION=add) processed
ptp0: Handling device node '/dev/ptp0', devnum=c246:0
ptp0: Preserve permissions of /dev/ptp0, uid=0, gid=0, mode=0600
0000:02: sd-device-monitor: Passed 176 byte to netlink monitor
ptp0: Preserve already existing symlink '/dev/char/246:0' to '../ptp0'
usb4: sd-device: Created db file '/run/udev/data/c189:384' for '/devices/pci0000:00/0000:00:14.0/usb4'
ptp0: sd-device: Created empty file '/run/udev/data/c246:0' for '/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/ptp/ptp0'
usb4: Device (SEQNUM=2846, ACTION=add) processed
ptp0: Device (SEQNUM=2855, ACTION=add) processed
usb4: sd-device-monitor: Passed 830 byte to netlink monitor
ptp0: sd-device-monitor: Passed 214 byte to netlink monitor
event1: No entry found from hwdb.
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
event1: /usr/lib/udev/rules.d/60-evdev.rules:8 Failed to run builtin 'hwdb --subsystem=input --lookup-prefix=evdev:': No data available
4-0:1.0: sd-device-monitor: Passed 307 byte to netlink monitor
eth1: Processing device (SEQNUM=2861, ACTION=add)
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
PNP0C0B:00: /usr/lib/udev/rules.d/50-udev-default.rules:14 Importing properties from results of builtin command 'hwdb --subsystem=platform'
PNP0C0B:00: No entry found from hwdb.
PNP0C0B:00: /usr/lib/udev/rules.d/50-udev-default.rules:14 Failed to run builtin 'hwdb --subsystem=platform': No data available
value '[dmi/id]modalias' is 'dmi:bvnAmericanMegatrendsInc.:bvr1.4:bd06/28/2019:br5.6:svnADLINKTechnologyInc.:pncPCI-3620:pvrTobefilledbyO.E.M.:rvnTobefilledbyO.E.M.:rnTobefilledbyO.E.M.:rvrTobefilledbyO.E.M.:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:sku:'
PNP0C0B:00: /usr/lib/udev/rules.d/60-drm.rules:3 Importing properties from results of builtin command 'path_id'
event1: /usr/lib/udev/rules.d/60-evdev.rules:18 Importing properties from results of builtin command 'hwdb 'evdev:name:Sleep Button:phys:PNP0C0E/button/input0:ev:3:dmi:bvnAmericanMegatrendsInc.:bvr1.4:bd06/28/2019:br5.6:svnADLINKTechnologyInc.:pncPCI-3620:pvrTobefilledbyO.E.M.:rvnTobefilledbyO.E.M.:rnTobefilledbyO.E.M.:rvrTobefilledbyO.E.M.:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:sku:''
event1: No entry found from hwdb.
event1: /usr/lib/udev/rules.d/60-evdev.rules:18 Failed to run builtin 'hwdb 'evdev:name:Sleep Button:phys:PNP0C0E/button/input0:ev:3:dmi:bvnAmericanMegatrendsInc.:bvr1.4:bd06/28/2019:br5.6:svnADLINKTechnologyInc.:pncPCI-3620:pvrTobefilledbyO.E.M.:rvnTobefilledbyO.E.M.:rnTobefilledbyO.E.M.:rvrTobefilledbyO.E.M.:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:sku:'': No data available
4-0:1.0: Processing device (SEQNUM=2847, ACTION=add)
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
value '[dmi/id]modalias' is 'dmi:bvnAmericanMegatrendsInc.:bvr1.4:bd06/28/2019:br5.6:svnADLINKTechnologyInc.:pncPCI-3620:pvrTobefilledbyO.E.M.:rvnTobefilledbyO.E.M.:rnTobefilledbyO.E.M.:rvrTobefilledbyO.E.M.:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:sku:'
event1: /usr/lib/udev/rules.d/60-evdev.rules:23 Importing properties from results of builtin command 'hwdb 'evdev:name:Sleep Button:dmi:bvnAmericanMegatrendsInc.:bvr1.4:bd06/28/2019:br5.6:svnADLINKTechnologyInc.:pncPCI-3620:pvrTobefilledbyO.E.M.:rvnTobefilledbyO.E.M.:rnTobefilledbyO.E.M.:rvrTobefilledbyO.E.M.:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:sku:''
event1: No entry found from hwdb.
event1: /usr/lib/udev/rules.d/60-evdev.rules:23 Failed to run builtin 'hwdb 'evdev:name:Sleep Button:dmi:bvnAmericanMegatrendsInc.:bvr1.4:bd06/28/2019:br5.6:svnADLINKTechnologyInc.:pncPCI-3620:pvrTobefilledbyO.E.M.:rvnTobefilledbyO.E.M.:rnTobefilledbyO.E.M.:rvrTobefilledbyO.E.M.:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:sku:'': No data available
event1: /usr/lib/udev/rules.d/60-input-id.rules:5 Importing properties from results of builtin command 'input_id'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
input1: capabilities/ev raw kernel attribute: 3
input1: capabilities/abs raw kernel attribute: 0
input1: capabilities/rel raw kernel attribute: 0
input1: capabilities/key raw kernel attribute: 4000 0 0
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
input1: properties raw kernel attribute: 0
event1: test_key: checking bit block 0 for any keys; found=0
event1: test_key: checking bit block 64 for any keys; found=0
event1: test_key: checking bit block 128 for any keys; found=1
event1: test_key: checking bit block 192 for any keys; found=1
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
4-0:1.0: /usr/lib/udev/rules.d/50-udev-default.rules:14 Importing properties from results of builtin command 'hwdb --subsystem=usb'
4-0:1.0: /usr/lib/udev/rules.d/60-drm.rules:3 Importing properties from results of builtin command 'path_id'
eth1: /etc/udev/rules.d/70-persistent-net.rules:10 NAME 'eth1'
sda: /usr/lib/udev/rules.d/60-persistent-storage.rules:54 Importing properties from results of 'ata_id --export /dev/sda'
sda: Starting 'ata_id --export /dev/sda'
eth1: /usr/lib/udev/rules.d/75-net-description.rules:6 Importing properties from results of builtin command 'net_id'
Using default interface naming scheme 'v245'.
Successfully forked off '(spawn)' as PID 325.
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
eth1: sd-device-monitor: Passed 203 byte to netlink monitor
ptp2: sd-device-monitor: Passed 214 byte to netlink monitor
wakeup31: sd-device-monitor: Passed 188 byte to netlink monitor
ptp2: Processing device (SEQNUM=2862, ACTION=add)
usb2: sd-device-monitor: Passed 318 byte to netlink monitor
wakeup24: sd-device-monitor: Passed 201 byte to netlink monitor
wakeup31: Processing device (SEQNUM=2863, ACTION=add)
usb2: Processing device (SEQNUM=2869, ACTION=add)
0000:04:0e.1: Processing device (SEQNUM=2872, ACTION=add)
4-0:1.0: /usr/lib/udev/rules.d/60-libgphoto2-6.rules:9 Importing properties from results of builtin command 'usb_id'
0000:04:0e.1: sd-device-monitor: Passed 345 byte to netlink monitor
wakeup24: Processing device (SEQNUM=2871, ACTION=add)
0000:04:0f.0: Processing device (SEQNUM=2881, ACTION=add)
0000:04:0f.0: sd-device-monitor: Passed 329 byte to netlink monitor
0000:04: Processing device (SEQNUM=2913, ACTION=add)
PNP0C0B:00: /usr/lib/udev/rules.d/80-drivers.rules:5 RUN 'kmod load $env{MODALIAS}'
PNP0C0B:00: sd-device: Created db file '/run/udev/data/+platform:PNP0C0B:00' for '/devices/platform/PNP0C0B:00'
PNP0C0B:00: Running built-in command "kmod load acpi:PNP0C0B:"
Loading module: acpi:PNP0C0B:
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
Failed to find module 'acpi:PNP0C0B:'
PNP0C0B:00: Device (SEQNUM=2949, ACTION=add) processed
PNP0C0B:00: sd-device-monitor: Passed 256 byte to netlink monitor
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
eth0: /usr/lib/udev/rules.d/75-net-description.rules:12 Importing properties from results of builtin command 'hwdb --subsystem=pci'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
eth0: /usr/lib/udev/rules.d/80-net-setup-link.rules:5 Importing properties from results of builtin command 'path_id'
eth0: /usr/lib/udev/rules.d/80-net-setup-link.rules:9 Importing properties from results of builtin command 'net_setup_link'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
eth0: Config file /usr/lib/systemd/network/99-default.link is applied
ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.
eth0: Failed to query name_assign_type: Invalid argument
eth0: Policies didn't yield a name and Name= is not given, not renaming.
eth0: Device has addr_assign_type=0
eth0: MAC on the device already matches policy *persistent*
Could not set AlternativeName= or apply AlternativeNamesPolicy= on eth0: File exists
eth0: Could not apply link config, ignoring: File exists
eth0: /usr/lib/udev/rules.d/99-systemd.rules:62 RUN '/lib/systemd/systemd-sysctl --prefix=/net/ipv4/conf/$name --prefix=/net/ipv4/neigh/$name --prefix=/net/ipv6/conf/$name --prefix=/net/ipv6/neigh/$name'
eth0: sd-device: Created db file '/run/udev/data/n2' for '/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/net/eth0'
eth0: Running command "/lib/systemd/systemd-sysctl --prefix=/net/ipv4/conf/eth0 --prefix=/net/ipv4/neigh/eth0 --prefix=/net/ipv6/conf/eth0 --prefix=/net/ipv6/neigh/eth0"
eth0: Starting '/lib/systemd/systemd-sysctl --prefix=/net/ipv4/conf/eth0 --prefix=/net/ipv4/neigh/eth0 --prefix=/net/ipv6/conf/eth0 --prefix=/net/ipv6/neigh/eth0'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
ptp2: Handling device node '/dev/ptp2', devnum=c246:2
ptp2: Preserve permissions of /dev/ptp2, uid=0, gid=0, mode=0600
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
ptp2: Preserve already existing symlink '/dev/char/246:2' to '../ptp2'
ptp2: sd-device: Created empty file '/run/udev/data/c246:2' for '/devices/pci0000:00/0000:00:1c.1/0000:02:00.0/ptp/ptp2'
ptp2: Device (SEQNUM=2862, ACTION=add) processed
ptp2: sd-device-monitor: Passed 214 byte to netlink monitor
Successfully forked off '(spawn)' as PID 326.
0000:00:1c.3: /usr/lib/udev/rules.d/80-drivers.rules:5 RUN 'kmod load $env{MODALIAS}'
0000:00:1c.3: sd-device: Created db file '/run/udev/data/+pci:0000:00:1c.3' for '/devices/pci0000:00/0000:00:1c.3'
0000:00:1c.3: Running built-in command "kmod load pci:v00008086d00000F4Esv00008086sd00000F4Ebc06sc04i00"
Loading module: pci:v00008086d00000F4Esv00008086sd00000F4Ebc06sc04i00
Failed to find module 'pci:v00008086d00000F4Esv00008086sd00000F4Ebc06sc04i00'
0000:00:1c.3: Device (SEQNUM=2915, ACTION=add) processed
0000:00:1c.3: sd-device-monitor: Passed 556 byte to netlink monitor
4-0:1.0: Failed to access usb_interface: No such file or directory
4-0:1.0: /usr/lib/udev/rules.d/60-libgphoto2-6.rules:9 Failed to run builtin 'usb_id': No such file or directory
1:0:0:0: Device (SEQNUM=2822, ACTION=add) processed
1:0:0:0: sd-device-monitor: Passed 215 byte to netlink monitor
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
4-0:1.0: /usr/lib/udev/rules.d/80-drivers.rules:5 RUN 'kmod load $env{MODALIAS}'
usb3: Handling device node '/dev/bus/usb/003/001', devnum=c189:256
usb3: Preserve permissions of /dev/bus/usb/003/001, uid=0, gid=0, mode=0664
usb3: Preserve already existing symlink '/dev/char/189:256' to '../bus/usb/003/001'
usb3: sd-device: Created db file '/run/udev/data/c189:256' for '/devices/pci0000:00/0000:00:14.0/usb3'
4-0:1.0: sd-device: Created db file '/run/udev/data/+usb:4-0:1.0' for '/devices/pci0000:00/0000:00:14.0/usb4/4-0:1.0'
usb3: Device (SEQNUM=2828, ACTION=add) processed
4-0:1.0: Running built-in command "kmod load usb:v1D6Bp0003d0515dc09dsc00dp03ic09isc00ip00in00"
Loading module: usb:v1D6Bp0003d0515dc09dsc00dp03ic09isc00ip00in00
usb3: sd-device-monitor: Passed 830 byte to netlink monitor
Failed to find module 'usb:v1D6Bp0003d0515dc09dsc00dp03ic09isc00ip00in00'
4-0:1.0: Device (SEQNUM=2847, ACTION=add) processed
4-0:1.0: sd-device-monitor: Passed 493 byte to netlink monitor
1:0:0:0: Handling device node '/dev/bsg/1:0:0:0', devnum=c243:0
1:0:0:0: Preserve permissions of /dev/bsg/1:0:0:0, uid=0, gid=0, mode=0600
1:0:0:0: Preserve already existing symlink '/dev/char/243:0' to '../bsg/1:0:0:0'
1:0:0:0: sd-device: Created empty file '/run/udev/data/c243:0' for '/devices/pci0000:00/0000:00:13.0/ata2/host1/target1:0:0/1:0:0:0/bsg/1:0:0:0'
1:0:0:0: Device (SEQNUM=2821, ACTION=add) processed
1:0:0:0: sd-device-monitor: Passed 242 byte to netlink monitor
0000:04: sd-device-monitor: Passed 189 byte to netlink monitor
eth1: /usr/lib/udev/rules.d/75-net-description.rules:12 Importing properties from results of builtin command 'hwdb --subsystem=pci'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
0000:04:0f.0: /usr/lib/udev/rules.d/50-udev-default.rules:14 Importing properties from results of builtin command 'hwdb --subsystem=pci'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
wakeup24: Device (SEQNUM=2871, ACTION=add) processed
0000:04:0e.1: /usr/lib/udev/rules.d/50-udev-default.rules:14 Importing properties from results of builtin command 'hwdb --subsystem=pci'
wakeup24: sd-device-monitor: Passed 201 byte to netlink monitor
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
usb2: /usr/lib/udev/rules.d/50-udev-default.rules:13 Importing properties from results of builtin command 'usb_id'
usb2: /usr/lib/udev/rules.d/50-udev-default.rules:13 Importing properties from results of builtin command 'hwdb --subsystem=usb'
usb2: /usr/lib/udev/rules.d/50-udev-default.rules:48 MODE 0664
wakeup31: Device (SEQNUM=2863, ACTION=add) processed
wakeup31: sd-device-monitor: Passed 188 byte to netlink monitor
usb2: /usr/lib/udev/rules.d/60-autosuspend-chromiumos.rules:130 ATTR '/sys/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/0000:04:0e.0/usb2/power/control' writing 'auto'
usb2: /usr/lib/udev/rules.d/60-drm.rules:3 Importing properties from results of builtin command 'path_id'
0000:04:0e.1: /usr/lib/udev/rules.d/80-drivers.rules:5 RUN 'kmod load $env{MODALIAS}'
sg0: /usr/lib/udev/rules.d/50-udev-default.rules:70 GROUP 6
1:0:0:0: Device (SEQNUM=2823, ACTION=add) processed
1:0:0:0: sd-device-monitor: Passed 211 byte to netlink monitor
sg0: Handling device node '/dev/sg0', devnum=c21:0
sg0: Setting permissions /dev/sg0, uid=0, gid=6, mode=0660
sg0: Preserve already existing symlink '/dev/char/21:0' to '../sg0'
sg0: sd-device: Created empty file '/run/udev/data/c21:0' for '/devices/pci0000:00/0000:00:13.0/ata2/host1/target1:0:0/1:0:0:0/scsi_generic/sg0'
sg0: Device (SEQNUM=2824, ACTION=add) processed
sg0: sd-device-monitor: Passed 247 byte to netlink monitor
eth1: /usr/lib/udev/rules.d/80-net-setup-link.rules:5 Importing properties from results of builtin command 'path_id'
eth1: /usr/lib/udev/rules.d/80-net-setup-link.rules:9 Importing properties from results of builtin command 'net_setup_link'
0000:04:0e.1: sd-device: Created db file '/run/udev/data/+pci:0000:04:0e.1' for '/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/0000:04:0e.1'
Inserted module 'mei_txe'
0000:00:1a.0: Device (SEQNUM=2849, ACTION=add) processed
0000:00:1a.0: sd-device-monitor: Passed 531 byte to netlink monitor
0000:04:0f.0: /usr/lib/udev/rules.d/80-drivers.rules:5 RUN 'kmod load $env{MODALIAS}'
usb2: Handling device node '/dev/bus/usb/002/001', devnum=c189:128
usb2: Preserve permissions of /dev/bus/usb/002/001, uid=0, gid=0, mode=0664
0000:04:0f.0: sd-device: Created db file '/run/udev/data/+pci:0000:04:0f.0' for '/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/0000:04:0f.0'
usb2: Preserve already existing symlink '/dev/char/189:128' to '../bus/usb/002/001'
0000:04:0f.0: Running built-in command "kmod load pci:v000012D8d0000E110sv00000000sd00000000bc06sc04i00"
Loading module: pci:v000012D8d0000E110sv00000000sd00000000bc06sc04i00
Failed to find module 'pci:v000012D8d0000E110sv00000000sd00000000bc06sc04i00'
0000:04:0f.0: Device (SEQNUM=2881, ACTION=add) processed
0000:04:0f.0: sd-device-monitor: Passed 554 byte to netlink monitor
usb2: sd-device: Created db file '/run/udev/data/c189:128' for '/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/0000:04:0e.0/usb2'
usb2: Device (SEQNUM=2869, ACTION=add) processed
usb2: sd-device-monitor: Passed 871 byte to netlink monitor
0000:04: Device (SEQNUM=2913, ACTION=add) processed
0000:04: sd-device-monitor: Passed 189 byte to netlink monitor
0000:04:0e.1: Running built-in command "kmod load pci:v00001033d000000E0sv00001033sd000000E0bc0Csc03i20"
Loading module: pci:v00001033d000000E0sv00001033sd000000E0bc0Csc03i20
Failed to find module 'pci:v00001033d000000E0sv00001033sd000000E0bc0Csc03i20'
0000:04:0e.1: Device (SEQNUM=2872, ACTION=add) processed
0000:04:0e.1: sd-device-monitor: Passed 567 byte to netlink monitor
eth1: Config file /usr/lib/systemd/network/99-default.link is applied
ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.
eth1: Failed to query name_assign_type: Invalid argument
eth1: Policies didn't yield a name and Name= is not given, not renaming.
eth1: Device has addr_assign_type=0
eth1: MAC on the device already matches policy *persistent*
Could not set AlternativeName= or apply AlternativeNamesPolicy= on eth1: File exists
eth1: Could not apply link config, ignoring: File exists
eth1: /usr/lib/udev/rules.d/99-systemd.rules:62 RUN '/lib/systemd/systemd-sysctl --prefix=/net/ipv4/conf/$name --prefix=/net/ipv4/neigh/$name --prefix=/net/ipv6/conf/$name --prefix=/net/ipv6/neigh/$name'
eth1: sd-device: Created db file '/run/udev/data/n3' for '/devices/pci0000:00/0000:00:1c.1/0000:02:00.0/net/eth1'
eth1: Running command "/lib/systemd/systemd-sysctl --prefix=/net/ipv4/conf/eth1 --prefix=/net/ipv4/neigh/eth1 --prefix=/net/ipv6/conf/eth1 --prefix=/net/ipv6/neigh/eth1"
eth1: Starting '/lib/systemd/systemd-sysctl --prefix=/net/ipv4/conf/eth1 --prefix=/net/ipv4/neigh/eth1 --prefix=/net/ipv6/conf/eth1 --prefix=/net/ipv6/neigh/eth1'
Successfully forked off '(spawn)' as PID 328.
ACPI0003:00: sd-device-monitor: Passed 197 byte to netlink monitor
ACPI0003:00: Processing device (SEQNUM=2936, ACTION=add)
cmos_nvram0: Device (SEQNUM=2995, ACTION=add) is queued
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
3-0:1.0: sd-device-monitor: Passed 307 byte to netlink monitor
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
ACPI0003:00: /usr/lib/udev/rules.d/50-udev-default.rules:14 Importing properties from results of builtin command 'hwdb --subsystem=platform'
3-1: sd-device-monitor: Passed 299 byte to netlink monitor
3-1: Processing device (SEQNUM=2830, ACTION=add)
3-4: Processing device (SEQNUM=2844, ACTION=add)
ACPI0003:00: No entry found from hwdb.
ACPI0003:00: /usr/lib/udev/rules.d/50-udev-default.rules:14 Failed to run builtin 'hwdb --subsystem=platform': No data available
ACPI0003:00: /usr/lib/udev/rules.d/60-drm.rules:3 Importing properties from results of builtin command 'path_id'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
3-1: /usr/lib/udev/rules.d/50-udev-default.rules:13 Importing properties from results of builtin command 'usb_id'
3-4: /usr/lib/udev/rules.d/50-udev-default.rules:13 Importing properties from results of builtin command 'usb_id'
ACPI0003:00: /usr/lib/udev/rules.d/80-drivers.rules:5 RUN 'kmod load $env{MODALIAS}'
3-1: /usr/lib/udev/rules.d/50-udev-default.rules:13 Importing properties from results of builtin command 'hwdb --subsystem=usb'
3-4: /usr/lib/udev/rules.d/50-udev-default.rules:13 Importing properties from results of builtin command 'hwdb --subsystem=usb'
ACPI0003:00: sd-device: Created db file '/run/udev/data/+platform:ACPI0003:00' for '/devices/pci0000:00/0000:00:1f.0/ACPI0003:00'
3-1: /usr/lib/udev/rules.d/50-udev-default.rules:48 MODE 0664
ACPI0003:00: Running built-in command "kmod load acpi:ACPI0003:"
Loading module: acpi:ACPI0003:
3-0:1.0: Processing device (SEQNUM=2829, ACTION=add)
3-1: /usr/lib/udev/rules.d/60-drm.rules:3 Importing properties from results of builtin command 'path_id'
Failed to find module 'acpi:ACPI0003:'
ACPI0003:00: Device (SEQNUM=2936, ACTION=add) processed
ACPI0003:00: sd-device-monitor: Passed 293 byte to netlink monitor
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
event0: 'libinput-device-group /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0/event0'(out) 'LIBINPUT_DEVICE_GROUP=19/0/1:PNP0C0C/button'
value '[dmi/id]sys_vendor' is 'ADLINK Technology Inc.'
3-0:1.0: /usr/lib/udev/rules.d/50-udev-default.rules:14 Importing properties from results of builtin command 'hwdb --subsystem=usb'
event0: Process 'libinput-device-group /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0/event0' succeeded.
3-0:1.0: /usr/lib/udev/rules.d/60-drm.rules:3 Importing properties from results of builtin command 'path_id'
event0: Handling device node '/dev/input/event0', devnum=c13:64
event0: Setting permissions /dev/input/event0, uid=0, gid=107, mode=0660
event0: Preserve already existing symlink '/dev/char/13:64' to '../input/event0'
event0: sd-device: Created db file '/run/udev/data/c13:64' for '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0/event0'
event0: Device (SEQNUM=2780, ACTION=add) processed
event0: sd-device-monitor: Passed 443 byte to netlink monitor
rrhy
帖子: 10
注册时间: 2023-03-02 14:12
系统: ubuntu20.04

Re: 【Ubuntu20.04】多个网口,每次启动网口的名称不固定

#8

帖子 rrhy » 2023-03-03 15:41

解决了!

解决方法:
1. 使用命令lspci | grep Eth查出设备号

代码: 全选

01:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
02:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
07:00.0 Ethernet controller: Intel Corporation I211 Gigabit Network Connection (rev 03)
08:00.0 Ethernet controller: Intel Corporation I211 Gigabit Network Connection (rev 03)
09:00.0 Ethernet controller: Intel Corporation I211 Gigabit Network Connection (rev 03)
0a:00.0 Ethernet controller: Intel Corporation I211 Gigabit Network Connection (rev 03)
0d:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
0e:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
2. 文件/etc/default/grubGRUB_CMDLINE_LINUX不加net.ifnames=0 biosdevname=0恢复为

代码: 全选

GRUB_CMDLINE_LINUX="acpi_enforce_resources=lax text"
执行update-grub

3. 文件/etc/udev/rules.d/70-persistent-net.rules中删除掉正则表达式的内容

代码: 全选

#00:30:64:35:48:e6 enp1s0
SUBSYSTEM=="net", ACTION=="add", ATTR{type}=="1", KERNELS=="0000:01:00.0", NAME="eth0"
#00:30:64:35:48:e7 enp2s0
SUBSYSTEM=="net", ACTION=="add", ATTR{type}=="1", KERNELS=="0000:02:00.0", NAME="eth1"
#00:c0:3a:ae:61:8f enp7s0
SUBSYSTEM=="net", ACTION=="add", ATTR{type}=="1", KERNELS=="0000:07:00.0", NAME="u7"
#00:c0:3a:ae:63:8f enp8s0
SUBSYSTEM=="net", ACTION=="add", ATTR{type}=="1", KERNELS=="0000:08:00.0", NAME="u8"
#00:c0:3a:ae:65:8f enp9s0
SUBSYSTEM=="net", ACTION=="add", ATTR{type}=="1", KERNELS=="0000:09:00.0", NAME="u9"
#00:c0:3a:ae:67:8f enp10s0
SUBSYSTEM=="net", ACTION=="add", ATTR{type}=="1", KERNELS=="0000:0a:00.0", NAME="u10"
#00:30:64:34:92:e6 enp13s0
SUBSYSTEM=="net", ACTION=="add", ATTR{type}=="1", KERNELS=="0000:0d:00.0", NAME="u13"
#00:30:64:34:92:e7 enp14s0
SUBSYSTEM=="net", ACTION=="add", ATTR{type}=="1", KERNELS=="0000:0e:00.0", NAME="u14"
4. 感谢astolia花时间跑了配置,帮我确认了可行性.建议的命令udevadm info -a /sys/class/net/eth0解答了我长久不知道70-persistent-net.rules里面参数的疑问. 谢谢版主astolia,菜鸟学习了,谢谢!
回复