Pour forcer le nom de l'interface, j'ai suivi la solution proposée par Cali.
Exemple avec un serveur qui possède 3 cartes réseau :
- 2x Broadcom NetXtreme II BCM5716 1000Base-T intégrées
- 1x Intel Ethernet Controller 10-Gigabit X540-AT2 sur carte PCI-Express
Situation avant : Les interfaces se nomment respectivement eno1, eno2 et enp1s0
# dmesg | grep -e ixgbe -e bnx2
[ 1.916830] bnx2 0000:02:00.0 eth0: Broadcom NetXtreme II BCM5716 1000Base-T (C0) PCI Express found at mem c0000000, IRQ 16, node addr d0:67:e5:e9:ba:b4
[ 1.992674] bnx2 0000:02:00.1 eth1: Broadcom NetXtreme II BCM5716 1000Base-T (C0) PCI Express found at mem c2000000, IRQ 17, node addr d0:67:e5:e9:ba:b5
[ 2.067633] bnx2 0000:02:00.0 eno1: renamed from eth0
[ 2.215307] bnx2 0000:02:00.1 eno2: renamed from eth1
[ 2.445372] ixgbe: Intel(R) 10 Gigabit PCI Express Network Driver
[ 2.459405] ixgbe: Copyright (c) 1999-2016 Intel Corporation.
[ 2.825705] ixgbe 0000:01:00.0: Multiqueue Enabled: Rx Queue count = 8, Tx Queue count = 8 XDP Queue count = 0
[ 2.945325] ixgbe 0000:01:00.0: 32.000 Gb/s available PCIe bandwidth (5.0 GT/s PCIe x8 link)
[ 3.072428] ixgbe 0000:01:00.0: MAC: 3, PHY: 0, PBA No: G54042-005
[ 3.072431] ixgbe 0000:01:00.0: a0:36:9f:31:81:5a
[ 3.220244] ixgbe 0000:01:00.0: Intel(R) 10 Gigabit Network Connection
[ 3.221260] ixgbe 0000:01:00.0 enp1s0: renamed from eth0
[ 17.912646] bnx2 0000:02:00.0 eno1: using MSIX
[ 21.021636] bnx2 0000:02:00.0 eno1: NIC Copper Link is Up, 1000 Mbps full duplex
Je crée 3 fichiers :
/etc/systemd/network/10-eth0.link
[Match]
MACAddress=d0:67:e5:e9:ba:b4
[Link]
Name=eth0
/etc/systemd/network/10-eth1.link
[Match]
MACAddress=d0:67:e5:e9:ba:b5
[Link]
Name=eth1
/etc/systemd/network/10-eth2.link
[Match]
MACAddress=a0:36:9f:31:81:5a
[Link]
Name=eth2
Ne pas oublier de modifier le fichier /etc/network/interfaces avant de redémarrer !
Situation après : Les interfaces sont renommées deux fois pour revenir avec le nom eth0, eth1 et eth2
# dmesg | grep -e ixgbe -e bnx2
[ 1.884979] bnx2 0000:02:00.0 eth0: Broadcom NetXtreme II BCM5716 1000Base-T (C0) PCI Express found at mem c0000000, IRQ 16, node addr d0:67:e5:e9:ba:b4
[ 1.887897] bnx2 0000:02:00.1 eth1: Broadcom NetXtreme II BCM5716 1000Base-T (C0) PCI Express found at mem c2000000, IRQ 17, node addr d0:67:e5:e9:ba:b5
[ 1.892101] bnx2 0000:02:00.0 eno1: renamed from eth0
[ 2.044372] bnx2 0000:02:00.1 eno2: renamed from eth1
[ 2.410280] ixgbe: Intel(R) 10 Gigabit PCI Express Network Driver
[ 2.410282] ixgbe: Copyright (c) 1999-2016 Intel Corporation.
[ 2.750480] ixgbe 0000:01:00.0: Multiqueue Enabled: Rx Queue count = 8, Tx Queue count = 8 XDP Queue count = 0
[ 2.852492] ixgbe 0000:01:00.0: 32.000 Gb/s available PCIe bandwidth (5.0 GT/s PCIe x8 link)
[ 2.976427] ixgbe 0000:01:00.0: MAC: 3, PHY: 0, PBA No: G54042-005
[ 3.007609] ixgbe 0000:01:00.0: a0:36:9f:31:81:5a
[ 3.166265] ixgbe 0000:01:00.0: Intel(R) 10 Gigabit Network Connection
[ 3.167374] ixgbe 0000:01:00.0 enp1s0: renamed from eth0
[ 13.073045] bnx2 0000:02:00.0 eth0: renamed from eno1
[ 13.202516] bnx2 0000:02:00.1 eth1: renamed from eno2
[ 13.230700] ixgbe 0000:01:00.0 eth2: renamed from enp1s0
[ 19.624093] bnx2 0000:02:00.0 eth0: using MSIX
[ 22.814094] bnx2 0000:02:00.0 eth0: NIC Copper Link is Up, 1000 Mbps full duplex
Plus de risque de changement de nom à l'avnir !