root@debtxt00:~# # avant de créer la règle udev :
root@debtxt00:~# udevadm info -a -p /sys/class/net/ens8
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:08.0/net/ens8':
KERNEL=="ens8"
SUBSYSTEM=="net"
DRIVER==""
ATTR{addr_assign_type}=="0"
ATTR{addr_len}=="6"
ATTR{address}=="52:54:00:28:93:86"
ATTR{broadcast}=="ff:ff:ff:ff:ff:ff"
ATTR{carrier_changes}=="0"
ATTR{dev_id}=="0x0"
ATTR{dev_port}=="0"
ATTR{flags}=="0x1002"
ATTR{gro_flush_timeout}=="0"
ATTR{ifalias}==""
ATTR{ifindex}=="3"
ATTR{iflink}=="3"
ATTR{link_mode}=="0"
ATTR{mtu}=="1500"
ATTR{name_assign_type}=="4"
ATTR{netdev_group}=="0"
ATTR{operstate}=="down"
ATTR{proto_down}=="0"
ATTR{tx_queue_len}=="1000"
ATTR{type}=="1"
looking at parent device '/devices/pci0000:00/0000:00:08.0':
KERNELS=="0000:00:08.0"
SUBSYSTEMS=="pci"
DRIVERS=="8139cp"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x020000"
ATTRS{consistent_dma_mask_bits}=="64"
ATTRS{d3cold_allowed}=="0"
ATTRS{device}=="0x8139"
ATTRS{dma_mask_bits}=="64"
ATTRS{driver_override}=="(null)"
ATTRS{enable}=="1"
ATTRS{irq}=="11"
ATTRS{local_cpulist}=="0-7"
ATTRS{local_cpus}=="ff"
ATTRS{msi_bus}=="1"
ATTRS{numa_node}=="-1"
ATTRS{subsystem_device}=="0x1100"
ATTRS{subsystem_vendor}=="0x1af4"
ATTRS{vendor}=="0x10ec"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
root@debtxt00:~# udevadm info -a -p /sys/class/net/ens9
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:09.0/net/ens9':
KERNEL=="ens9"
SUBSYSTEM=="net"
DRIVER==""
ATTR{addr_assign_type}=="0"
ATTR{addr_len}=="6"
ATTR{address}=="52:54:00:bb:a0:72"
ATTR{broadcast}=="ff:ff:ff:ff:ff:ff"
ATTR{carrier_changes}=="0"
ATTR{dev_id}=="0x0"
ATTR{dev_port}=="0"
ATTR{flags}=="0x1002"
ATTR{gro_flush_timeout}=="0"
ATTR{ifalias}==""
ATTR{ifindex}=="4"
ATTR{iflink}=="4"
ATTR{link_mode}=="0"
ATTR{mtu}=="1500"
ATTR{name_assign_type}=="4"
ATTR{netdev_group}=="0"
ATTR{operstate}=="down"
ATTR{proto_down}=="0"
ATTR{tx_queue_len}=="1000"
ATTR{type}=="1"
looking at parent device '/devices/pci0000:00/0000:00:09.0':
KERNELS=="0000:00:09.0"
SUBSYSTEMS=="pci"
DRIVERS=="8139cp"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x020000"
ATTRS{consistent_dma_mask_bits}=="64"
ATTRS{d3cold_allowed}=="0"
ATTRS{device}=="0x8139"
ATTRS{dma_mask_bits}=="64"
ATTRS{driver_override}=="(null)"
ATTRS{enable}=="1"
ATTRS{irq}=="10"
ATTRS{local_cpulist}=="0-7"
ATTRS{local_cpus}=="ff"
ATTRS{msi_bus}=="1"
ATTRS{numa_node}=="-1"
ATTRS{subsystem_device}=="0x1100"
ATTRS{subsystem_vendor}=="0x1af4"
ATTRS{vendor}=="0x10ec"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
root@debtxt00:~#
root@debtxt00:~# # je créé maintenant la règle udev en utilisant ens* et je redémarrerai
root@debtxt00:~# cat /etc/udev/rules.d/70-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:bb:a0:72", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="ens*" NAME="ens8"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:28:93:86", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="ens*" NAME="ens9"
root@debtxt00:~#
root@debtxt00:~# # je redémarre la machine après avoir créé la règle udev ci-dessus
root@debtxt00:~# udevadm info -a -p /sys/class/net/ens8
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:09.0/net/ens8':
KERNEL=="ens8"
SUBSYSTEM=="net"
DRIVER==""
ATTR{addr_assign_type}=="0"
ATTR{addr_len}=="6"
ATTR{address}=="52:54:00:bb:a0:72"
ATTR{broadcast}=="ff:ff:ff:ff:ff:ff"
ATTR{carrier_changes}=="0"
ATTR{dev_id}=="0x0"
ATTR{dev_port}=="0"
ATTR{flags}=="0x1002"
ATTR{gro_flush_timeout}=="0"
ATTR{ifalias}==""
ATTR{ifindex}=="3"
ATTR{iflink}=="3"
ATTR{link_mode}=="0"
ATTR{mtu}=="1500"
ATTR{name_assign_type}=="4"
ATTR{netdev_group}=="0"
ATTR{operstate}=="down"
ATTR{proto_down}=="0"
ATTR{tx_queue_len}=="1000"
ATTR{type}=="1"
looking at parent device '/devices/pci0000:00/0000:00:09.0':
KERNELS=="0000:00:09.0"
SUBSYSTEMS=="pci"
DRIVERS=="8139cp"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x020000"
ATTRS{consistent_dma_mask_bits}=="64"
ATTRS{d3cold_allowed}=="0"
ATTRS{device}=="0x8139"
ATTRS{dma_mask_bits}=="64"
ATTRS{driver_override}=="(null)"
ATTRS{enable}=="1"
ATTRS{irq}=="10"
ATTRS{local_cpulist}=="0-7"
ATTRS{local_cpus}=="ff"
ATTRS{msi_bus}=="1"
ATTRS{numa_node}=="-1"
ATTRS{subsystem_device}=="0x1100"
ATTRS{subsystem_vendor}=="0x1af4"
ATTRS{vendor}=="0x10ec"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
root@debtxt00:~# udevadm info -a -p /sys/class/net/ens9
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:08.0/net/ens9':
KERNEL=="ens9"
SUBSYSTEM=="net"
DRIVER==""
ATTR{addr_assign_type}=="0"
ATTR{addr_len}=="6"
ATTR{address}=="52:54:00:28:93:86"
ATTR{broadcast}=="ff:ff:ff:ff:ff:ff"
ATTR{carrier_changes}=="0"
ATTR{dev_id}=="0x0"
ATTR{dev_port}=="0"
ATTR{flags}=="0x1002"
ATTR{gro_flush_timeout}=="0"
ATTR{ifalias}==""
ATTR{ifindex}=="2"
ATTR{iflink}=="2"
ATTR{link_mode}=="0"
ATTR{mtu}=="1500"
ATTR{name_assign_type}=="4"
ATTR{netdev_group}=="0"
ATTR{operstate}=="down"
ATTR{proto_down}=="0"
ATTR{tx_queue_len}=="1000"
ATTR{type}=="1"
looking at parent device '/devices/pci0000:00/0000:00:08.0':
KERNELS=="0000:00:08.0"
SUBSYSTEMS=="pci"
DRIVERS=="8139cp"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x020000"
ATTRS{consistent_dma_mask_bits}=="64"
ATTRS{d3cold_allowed}=="0"
ATTRS{device}=="0x8139"
ATTRS{dma_mask_bits}=="64"
ATTRS{driver_override}=="(null)"
ATTRS{enable}=="1"
ATTRS{irq}=="11"
ATTRS{local_cpulist}=="0-7"
ATTRS{local_cpus}=="ff"
ATTRS{msi_bus}=="1"
ATTRS{numa_node}=="-1"
ATTRS{subsystem_device}=="0x1100"
ATTRS{subsystem_vendor}=="0x1af4"
ATTRS{vendor}=="0x10ec"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
root@debtxt00:~#
Extrait de dmesg :
[ 317.864042] 8139cp 0000:00:09.0 ens9: renamed from eth1
[ 317.899243] 8139cp 0000:00:08.0 ens8: renamed from eth0
[ 318.020768] ata1.01: NODEV after polling detection
[ 318.021469] ata1.00: ATAPI: QEMU DVD-ROM, 2.1.2, max UDMA/100
[ 318.022514] ata1.00: configured for MWDMA2
[ 318.024634] scsi 0:0:0:0: CD-ROM QEMU QEMU DVD-ROM 2.1. PQ: 0 ANSI: 5
[ 318.048874] sr 0:0:0:0: [sr0] scsi3-mmc drive: 4x/4x cd/rw xa/form2 tray
[ 318.048878] cdrom: Uniform CD-ROM driver Revision: 3.20
[ 318.049517] sr 0:0:0:0: Attached scsi CD-ROM sr0
[ 318.055150] usb 1-1: new high-speed USB device number 2 using ehci-pci
[ 318.186883] PM: Starting manual resume from disk
[ 318.186891] PM: Hibernation image partition 254:2 present
[ 318.186892] PM: Looking for hibernation image.
[ 318.187360] PM: Image not found (code -22)
[ 318.187362] PM: Hibernation image not present or could not be loaded.
[ 318.223450] usb 1-1: New USB device found, idVendor=0627, idProduct=0001
[ 318.223458] usb 1-1: New USB device strings: Mfr=1, Product=3, SerialNumber=5
[ 318.223462] usb 1-1: Product: QEMU USB Tablet
[ 318.223466] usb 1-1: Manufacturer: QEMU
[ 318.223470] usb 1-1: SerialNumber: 42
[ 318.233597] hidraw: raw HID events driver (C) Jiri Kosina
[ 318.242790] usbcore: registered new interface driver usbhid
[ 318.242794] usbhid: USB HID core driver
[ 318.247843] input: QEMU QEMU USB Tablet as /devices/pci0000:00/0000:00:04.7/usb1/1-1/1-1:1.0/0003:0627:0001.0001/input/input4
[ 318.248268] hid-generic 0003:0627:0001.0001: input,hidraw0: USB HID v0.01 Pointer [QEMU QEMU USB Tablet] on usb-0000:00:04.7-1/input0
[ 318.320265] EXT4-fs (vda1): mounted filesystem with ordered data mode. Opts: (null)
[ 318.370930] random: fast init done
[ 318.414248] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 318.423473] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
[ 318.423517] systemd[1]: Detected virtualization qemu.
[ 318.423522] systemd[1]: Detected architecture x86-64.
[ 318.423646] systemd[1]: Set hostname to <debtxt00>.
[ 318.428371] tsc: Refined TSC clocksource calibration: 1995.455 MHz
[ 318.428397] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x3986d1b8ac3, max_idle_ns: 881590518883 ns
[ 318.460117] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[ 318.460308] systemd[1]: Created slice System Slice.
[ 318.460874] systemd[1]: Mounting POSIX Message Queue File System...
[ 318.461839] systemd[1]: Mounting Debug File System...
[ 318.461954] systemd[1]: Listening on Syslog Socket.
[ 318.462240] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[ 318.474212] EXT4-fs (vda1): re-mounted. Opts: errors=remount-ro
[ 318.529210] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input5
[ 318.529216] ACPI: Power Button [PWRF]
[ 318.542685] [drm] Initialized
[ 318.543255] systemd-journald[256]: Received request to flush runtime journal from PID 1
[ 318.549565] input: PC Speaker as /devices/platform/pcspkr/input/input6
[ 318.549862] 8139cp 0000:00:08.0 rename2: renamed from ens8
[ 318.571227] Adding 4080636k swap on /dev/vda2. Priority:-1 extents:1 across:4080636k FS
[ 318.589669] 8139cp 0000:00:09.0 ens8: renamed from ens9
[ 318.637409] 8139cp 0000:00:08.0 ens9: renamed from rename2
Tandis qu’en utilisant eth* dans la règle udev
et après avoir redémarré avec la règle udev utilisant eth*
ça ne fonctionne pas sur ma machine virtuelle
root@debtxt00:~# cat /etc/udev/rules.d/70-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:bb:a0:72", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*" NAME="ens8"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:28:93:86", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*" NAME="ens9"
root@debtxt00:~# udevadm info -a -p /sys/class/net/ens8
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:08.0/net/ens8':
KERNEL=="ens8"
SUBSYSTEM=="net"
DRIVER==""
ATTR{addr_assign_type}=="0"
ATTR{addr_len}=="6"
ATTR{address}=="52:54:00:28:93:86"
ATTR{broadcast}=="ff:ff:ff:ff:ff:ff"
ATTR{carrier_changes}=="0"
ATTR{dev_id}=="0x0"
ATTR{dev_port}=="0"
ATTR{flags}=="0x1002"
ATTR{gro_flush_timeout}=="0"
ATTR{ifalias}==""
ATTR{ifindex}=="3"
ATTR{iflink}=="3"
ATTR{link_mode}=="0"
ATTR{mtu}=="1500"
ATTR{name_assign_type}=="4"
ATTR{netdev_group}=="0"
ATTR{operstate}=="down"
ATTR{proto_down}=="0"
ATTR{tx_queue_len}=="1000"
ATTR{type}=="1"
looking at parent device '/devices/pci0000:00/0000:00:08.0':
KERNELS=="0000:00:08.0"
SUBSYSTEMS=="pci"
DRIVERS=="8139cp"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x020000"
ATTRS{consistent_dma_mask_bits}=="64"
ATTRS{d3cold_allowed}=="0"
ATTRS{device}=="0x8139"
ATTRS{dma_mask_bits}=="64"
ATTRS{driver_override}=="(null)"
ATTRS{enable}=="1"
ATTRS{irq}=="11"
ATTRS{local_cpulist}=="0-7"
ATTRS{local_cpus}=="ff"
ATTRS{msi_bus}=="1"
ATTRS{numa_node}=="-1"
ATTRS{subsystem_device}=="0x1100"
ATTRS{subsystem_vendor}=="0x1af4"
ATTRS{vendor}=="0x10ec"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
root@debtxt00:~# udevadm info -a -p /sys/class/net/ens9
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:09.0/net/ens9':
KERNEL=="ens9"
SUBSYSTEM=="net"
DRIVER==""
ATTR{addr_assign_type}=="0"
ATTR{addr_len}=="6"
ATTR{address}=="52:54:00:bb:a0:72"
ATTR{broadcast}=="ff:ff:ff:ff:ff:ff"
ATTR{carrier_changes}=="0"
ATTR{dev_id}=="0x0"
ATTR{dev_port}=="0"
ATTR{flags}=="0x1002"
ATTR{gro_flush_timeout}=="0"
ATTR{ifalias}==""
ATTR{ifindex}=="4"
ATTR{iflink}=="4"
ATTR{link_mode}=="0"
ATTR{mtu}=="1500"
ATTR{name_assign_type}=="4"
ATTR{netdev_group}=="0"
ATTR{operstate}=="down"
ATTR{proto_down}=="0"
ATTR{tx_queue_len}=="1000"
ATTR{type}=="1"
looking at parent device '/devices/pci0000:00/0000:00:09.0':
KERNELS=="0000:00:09.0"
SUBSYSTEMS=="pci"
DRIVERS=="8139cp"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x020000"
ATTRS{consistent_dma_mask_bits}=="64"
ATTRS{d3cold_allowed}=="0"
ATTRS{device}=="0x8139"
ATTRS{dma_mask_bits}=="64"
ATTRS{driver_override}=="(null)"
ATTRS{enable}=="1"
ATTRS{irq}=="10"
ATTRS{local_cpulist}=="0-7"
ATTRS{local_cpus}=="ff"
ATTRS{msi_bus}=="1"
ATTRS{numa_node}=="-1"
ATTRS{subsystem_device}=="0x1100"
ATTRS{subsystem_vendor}=="0x1af4"
ATTRS{vendor}=="0x10ec"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
root@debtxt00:~#
C’est pas du tout un “cirage de pompes” mais, sincèrement, j’apprécie énormément la qualité de tes messages, et à côté, je me sens tout petit.