есть у меня сервер с CentOS 6 с доступом только по ssh, и хочется на него установить что-нибудь по свежее. Доступ к IPMI тоже есть, только логин-пароль от IPMI я не знаю. Хочу через debootstrap установить Debian Stretch (самое свежее, что может работать с ядром 2.6.32). Т.к. reboot можно сделать только единожды, я начал тренироваться на кошках.
Взял второй компьютер, установил CentOS 6, включил sshd, подвинул LVM разделы, создал новый, через debootstrap установил туда chroot окружение для debian stretch, в нём всё вроде настроил, установил ядро 4.9.0, настроил grub, загружаюсь в debian, а там нет сети.
# ip link show
1: lo: ....
2: enp2s0: ....
ОК, исправляю /etc/network/interfaces c
source-directory /etc/network/interfaces.d
auto eth0
iface eth0 inet dhcp
на
source-directory /etc/network/interfaces.d
auto enp2s0
iface enp2s0 inet dhcp
всё работает.
Но проблема в том, что понять, что eth0
это enp2s0
надо как-то в centos или в chroot-debian. Пробую:
0(stretch)root@localhost:/# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
link/ether 8c:89:a5:8b:27:21 brd ff:ff:ff:ff:ff:ff
0(stretch)root@localhost:/# ls /sys/class/net/
eth0 lo
0(stretch)root@localhost:/# dmesg | grep -i eth
[ 0.000000] atl1c 0000:02:00.0: atl1c: eth0 NIC Link is Up<1000 Mbps Full Duplex>
0(stretch)root@localhost:/# ls -l /sys/class/net/
total 0
lrwxrwxrwx 1 root root 0 Dec 31 20:35 eth0 -> ../../devices/pci0000:00/0000:00:1c.1/0000:02:00.0/net/eth0
lrwxrwxrwx 1 root root 0 Dec 31 20:35 lo -> ../../devices/virtual/net/lo
0(stretch)root@localhost:/# udevadm info -e | grep -i name
E: NAME="Power Button"
E: DEVNAME=/dev/input/event1
E: NAME="Power Button"
E: DEVNAME=/dev/input/event0
E: PCI_SLOT_NAME=0000:00:00.0
E: PCI_SLOT_NAME=0000:00:02.0
E: DEVNAME=/dev/dri/card0
E: DEVNAME=/dev/dri/controlD64
E: DEVNAME=/dev/dri/renderD128
E: DEVNAME=/dev/fb0
E: PCI_SLOT_NAME=0000:00:1b.0
E: NAME="HDA Intel Front Headphone"
E: DEVNAME=/dev/input/event10
E: NAME="HDA Intel Rear Mic"
E: DEVNAME=/dev/input/event3
E: NAME="HDA Intel Front Mic"
E: DEVNAME=/dev/input/event4
E: NAME="HDA Intel Line"
E: DEVNAME=/dev/input/event5
E: NAME="HDA Intel Line Out Front"
E: DEVNAME=/dev/input/event6
E: NAME="HDA Intel Line Out Surround"
E: DEVNAME=/dev/input/event7
E: NAME="HDA Intel Line Out CLFE"
E: DEVNAME=/dev/input/event8
E: NAME="HDA Intel Line Out Side"
E: DEVNAME=/dev/input/event9
E: DEVNAME=/dev/snd/controlC0
E: PCI_SLOT_NAME=0000:00:1c.0
E: PCI_SLOT_NAME=0000:00:1c.1
E: PCI_SLOT_NAME=0000:02:00.0
E: PCI_SLOT_NAME=0000:00:1c.2
E: PCI_SLOT_NAME=0000:00:1d.0
E: DEVNAME=/dev/bus/usb/002/001
E: DEVNAME=/dev/usbmon2
E: PCI_SLOT_NAME=0000:00:1d.1
E: DEVNAME=/dev/bus/usb/003/001
E: DEVNAME=/dev/usbmon3
E: PCI_SLOT_NAME=0000:00:1d.2
E: DEVNAME=/dev/bus/usb/004/001
E: DEVNAME=/dev/usbmon4
E: PCI_SLOT_NAME=0000:00:1d.3
E: DEVNAME=/dev/bus/usb/005/001
E: DEVNAME=/dev/usbmon5
E: PCI_SLOT_NAME=0000:00:1d.7
E: DEVNAME=/dev/bus/usb/001/001
E: DEVNAME=/dev/usbmon1
E: PCI_SLOT_NAME=0000:00:1e.0
E: PCI_SLOT_NAME=0000:00:1f.0
E: PCI_SLOT_NAME=0000:00:1f.1
E: PCI_SLOT_NAME=0000:00:1f.2
E: DEVNAME=/dev/sda
E: DEVNAME=/dev/sda1
E: DEVNAME=/dev/sda2
E: DEVNAME=/dev/bsg/2:0:0:0
E: DEVNAME=/dev/sg0
E: PCI_SLOT_NAME=0000:00:1f.3
E: DEVNAME=/dev/ttyS2
E: DEVNAME=/dev/ttyS3
E: DEVNAME=/dev/rtc0
E: DEVNAME=/dev/ttyS0
E: DEVNAME=/dev/ttyS1
E: DEVNAME=/dev/parport0
E: DEVNAME=/dev/loop0
E: DEVNAME=/dev/loop1
E: DEVNAME=/dev/loop2
E: DEVNAME=/dev/loop3
E: DEVNAME=/dev/loop4
E: DEVNAME=/dev/loop5
E: DEVNAME=/dev/loop6
E: DEVNAME=/dev/loop7
E: DEVNAME=/dev/ram0
E: DEVNAME=/dev/ram1
E: DEVNAME=/dev/ram10
E: DEVNAME=/dev/ram11
E: DEVNAME=/dev/ram12
E: DEVNAME=/dev/ram13
E: DEVNAME=/dev/ram14
E: DEVNAME=/dev/ram15
E: DEVNAME=/dev/ram2
E: DEVNAME=/dev/ram3
E: DEVNAME=/dev/ram4
E: DEVNAME=/dev/ram5
E: DEVNAME=/dev/ram6
E: DEVNAME=/dev/ram7
E: DEVNAME=/dev/ram8
E: DEVNAME=/dev/ram9
E: DEVNAME=/dev/cpu/0/cpuid
E: DEVNAME=/dev/cpu/1/cpuid
E: DEVNAME=/dev/cpu/2/cpuid
E: DEVNAME=/dev/cpu/3/cpuid
E: MODALIAS=dmi:bvnAmericanMegatrendsInc.:bvrV26.8:bd08/26/2011:svnMSI:pnMS-7592:pvr5.0:rvnMSI:rnG41M-P28(MS-7592):rvr5.0:cvnMSI:ct3:cvr5.0:
E: NAME="Macintosh mouse button emulation"
E: DEVNAME=/dev/input/event2
E: DEVNAME=/dev/input/mouse0
E: DEVNAME=/dev/input/mice
E: DEVNAME=/dev/full
E: DEVNAME=/dev/kmsg
E: DEVNAME=/dev/mem
E: DEVNAME=/dev/null
E: DEVNAME=/dev/oldmem
E: DEVNAME=/dev/port
E: DEVNAME=/dev/random
E: DEVNAME=/dev/urandom
E: DEVNAME=/dev/zero
E: DEVNAME=/dev/agpgart
E: DEVNAME=/dev/autofs
E: DEVNAME=/dev/cpu_dma_latency
E: DEVNAME=/dev/crash
E: DEVNAME=/dev/mapper/control
E: DEVNAME=/dev/hpet
E: DEVNAME=/dev/mcelog
E: DEVNAME=/dev/cpu/microcode
E: DEVNAME=/dev/network_latency
E: DEVNAME=/dev/network_throughput
E: DEVNAME=/dev/nvram
E: DEVNAME=/dev/infiniband/rdma_cm
E: DEVNAME=/dev/snapshot
E: DEVNAME=/dev/tgt
E: DEVNAME=/dev/uinput
E: DEVNAME=/dev/vga_arbiter
E: DEVNAME=/dev/watchdog
E: DEVNAME=/dev/cpu/0/msr
E: DEVNAME=/dev/cpu/1/msr
E: DEVNAME=/dev/cpu/2/msr
E: DEVNAME=/dev/cpu/3/msr
E: DEVNAME=/dev/raw/rawctl
E: DEVNAME=/dev/snd/hwC0D0
E: DEVNAME=/dev/snd/pcmC0D0c
E: DEVNAME=/dev/snd/pcmC0D0p
E: DEVNAME=/dev/snd/pcmC0D1p
E: DEVNAME=/dev/snd/seq
E: DEVNAME=/dev/snd/timer
E: DEVNAME=/dev/console
E: DEVNAME=/dev/ptmx
E: DEVNAME=/dev/tty1
...
E: DEVNAME=/dev/tty63
E: DEVNAME=/dev/usbmon0
E: DEVNAME=/dev/vcs
E: DEVNAME=/dev/vcs1
...
E: DEVNAME=/dev/vcs6
E: DEVNAME=/dev/vcsa
E: DEVNAME=/dev/vcsa1
...
E: DEVNAME=/dev/vcsa6
E: DEVNAME=/dev/dm-0
E: DEVNAME=/dev/dm-1
E: DEVNAME=/dev/dm-2
E: DEVNAME=/dev/dm-3
0(stretch)root@localhost:/# dmesg | grep -i 'net'
[ 0.000000] Initializing cgroup subsys net_cls
[ 0.000000] Initializing cgroup subsys net_prio
[ 0.000000] NET: Registered protocol family 16
[ 0.000000] NetLabel: Initializing
[ 0.000000] NetLabel: domain hash size = 128
[ 0.000000] NetLabel: protocols = UNLABELED CIPSOv4
[ 0.000000] NetLabel: unlabeled traffic allowed by default
[ 0.000000] NET: Registered protocol family 2
[ 0.000000] NET: Registered protocol family 1
[ 0.000000] audit: initializing netlink socket (disabled)
[ 0.000000] SELinux: Registering netfilter hooks
[ 0.000000] Initializing XFRM netlink socket
[ 0.000000] NET: Registered protocol family 17
[ 0.000000] Initalizing network drop monitor service
[ 0.000000] Microcode Update Driver: v2.00 <tigran@aivazian.fsnet.co.uk>, Peter Oruba
[ 0.000000] NET: Registered protocol family 10
[ 0.000000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 0.000000] ip_tables: (C) 2000-2006 Netfilter Core Team
0(stretch)root@localhost:/# dmesg | grep -i eth
[ 0.000000] atl1c 0000:02:00.0: atl1c: eth0 NIC Link is Up<1000 Mbps Full Duplex>
0(stretch)root@localhost:/# udevadm info -a -p /sys/class/net/eth0
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:1c.1/0000:02:00.0/net/eth0':
KERNEL=="eth0"
SUBSYSTEM=="net"
DRIVER==""
ATTR{addr_assign_type}=="0"
ATTR{addr_len}=="6"
ATTR{address}=="8c:89:a5:8b:27:21"
ATTR{broadcast}=="ff:ff:ff:ff:ff:ff"
ATTR{carrier}=="1"
ATTR{dev_id}=="0x0"
ATTR{dev_port}=="0"
ATTR{dormant}=="0"
ATTR{duplex}=="full"
ATTR{features}=="0x114989"
ATTR{flags}=="0x1003"
ATTR{gro_flush_timeout}=="0"
ATTR{ifalias}==""
ATTR{ifindex}=="2"
ATTR{iflink}=="2"
ATTR{link_mode}=="0"
ATTR{mtu}=="1500"
ATTR{operstate}=="up"
ATTR{speed}=="1000"
ATTR{tx_queue_len}=="1000"
ATTR{type}=="1"
looking at parent device '/devices/pci0000:00/0000:00:1c.1/0000:02:00.0':
KERNELS=="0000:02:00.0"
SUBSYSTEMS=="pci"
DRIVERS=="atl1c"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x020000"
ATTRS{device}=="0x1063"
ATTRS{enable}=="1"
ATTRS{irq}=="29"
ATTRS{local_cpulist}=="0-3"
ATTRS{local_cpus}=="f"
ATTRS{msi_bus}==""
ATTRS{numa_node}=="-1"
ATTRS{subsystem_device}=="0x7592"
ATTRS{subsystem_vendor}=="0x1462"
ATTRS{vendor}=="0x1969"
looking at parent device '/devices/pci0000:00/0000:00:1c.1':
KERNELS=="0000:00:1c.1"
SUBSYSTEMS=="pci"
DRIVERS=="pcieport"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x060400"
ATTRS{device}=="0x27d2"
ATTRS{enable}=="2"
ATTRS{irq}=="25"
ATTRS{local_cpulist}=="0-3"
ATTRS{local_cpus}=="f"
ATTRS{msi_bus}=="1"
ATTRS{numa_node}=="-1"
ATTRS{subsystem_device}=="0x0000"
ATTRS{subsystem_vendor}=="0x0000"
ATTRS{vendor}=="0x8086"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
и что-то ни каких намёков на enp2s0. Или я чего-то не вижу?
Чат GPT говорит, что «p2s0 или s33 — указывают на номер порта или слот на материнской плате»