renamed interfaces from 5.4 to 5.11

dirks

Member
Feb 6, 2016
26
19
23
44
Maybe hardware specific, with kernel pve-5.11 some Mellanox ConnectX-5 cards (onboard and pci) changed their names, which obviously caused havoc on our network config.

What does it say on Predictable Network Interface Names again?
> Stable interface names when kernels or drivers are updated/changed

;)


Code:
$ uname -r
5.11.7-1-pve
$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether XX brd ff:ff:ff:ff:ff:ff
3: eno2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether XX brd ff:ff:ff:ff:ff:ff
4: eno33np0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether XX brd ff:ff:ff:ff:ff:ff
5: eno34np1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether XX brd ff:ff:ff:ff:ff:ff
6: ens6f0np0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether XX brd ff:ff:ff:ff:ff:ff
7: ens6f1np1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether XX brd ff:ff:ff:ff:ff:ff
8: bond1: <NO-CARRIER,BROADCAST,MULTICAST,MASTER,UP> mtu 9000 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether XX brd ff:ff:ff:ff:ff:ff
9: bond0: <NO-CARRIER,BROADCAST,MULTICAST,MASTER,UP> mtu 1500 qdisc noqueue master vmbr0 state DOWN mode DEFAULT group default qlen 1000
    link/ether XX brd ff:ff:ff:ff:ff:ff
10: vmbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether XX brd ff:ff:ff:ff:ff:ff

Code:
$ uname -r
5.4.106-1-pve
$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether XX brd ff:ff:ff:ff:ff:ff
3: eno2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether XX brd ff:ff:ff:ff:ff:ff
4: eno33: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 9000 qdisc mq master bond1 state UP mode DEFAULT group default qlen 1000
    link/ether XX brd ff:ff:ff:ff:ff:ff
5: eno34: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP mode DEFAULT group default qlen 1000
    link/ether XX brd ff:ff:ff:ff:ff:ff
6: ens6f0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP mode DEFAULT group default qlen 1000
    link/ether XX brd ff:ff:ff:ff:ff:ff
7: ens6f1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 9000 qdisc mq master bond1 state UP mode DEFAULT group default qlen 1000
    link/ether XX brd ff:ff:ff:ff:ff:ff
8: bond1: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 9000 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether XX brd ff:ff:ff:ff:ff:ff
9: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue master vmbr0 state UP mode DEFAULT group default qlen 1000
    link/ether XX brd ff:ff:ff:ff:ff:ff
10: vmbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether XX brd ff:ff:ff:ff:ff:ff
 
To get the same effect for the kernel 5.4 you can edit the file /usr/lib/systemd/network/99-default.link, as I did, because I've got interfaces called like renamed3, renamed4,... after installing Proxmox 6.3 from the scratch:
Code:
root@asr2:~# uname -a
Linux asr2 5.4.106-1-pve #1 SMP PVE 5.4.106-1 (Fri, 19 Mar 2021 11:08:47 +0100) x86_64 GNU/Linux
root@asr2:~# ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp6s0f0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP mode DEFAULT group default qlen 1000
    link/ether 0c:c4:7a:80:06:e4 brd ff:ff:ff:ff:ff:ff
3: enp130s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 00:25:90:c5:13:8e brd ff:ff:ff:ff:ff:ff
4: enp6s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 0c:c4:7a:80:06:e5 brd ff:ff:ff:ff:ff:ff
5: enp7s0f0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP mode DEFAULT group default qlen 1000
    link/ether 0c:c4:7a:80:06:e4 brd ff:ff:ff:ff:ff:ff
6: enp7s0f1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 0c:c4:7a:80:06:e7 brd ff:ff:ff:ff:ff:ff
7: enp130s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 00:25:90:c5:13:8f brd ff:ff:ff:ff:ff:ff
root@asr2:~# cat /usr/lib/systemd/network/99-default.link
#  SPDX-License-Identifier: LGPL-2.1+
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Link]
#NamePolicy=keep kernel database onboard slot path
NamePolicy=path
MACAddressPolicy=persistent
 
To get the same effect for the kernel 5.4 you can edit the file /usr/lib/systemd/network/99-default.link, as I did, because I've got interfaces called like renamed3, renamed4,... after installing Proxmox 6.3 from the scratch:
[…]
root@asr2:~# cat /usr/lib/systemd/network/99-default.link
[…]

[Link]
#NamePolicy=keep kernel database onboard slot path
NamePolicy=path
MACAddressPolicy=persistent
[/CODE]

Thanks for the pointer. What basically happened on my systems is a rename of several ID_NET parameters

Code:
sudo udevadm info -e |grep ID_NET > interfaces_5.11
# do the same on kernel 5.4 with interfaces_5.4

diff interfaces_5.4 interfaces_5.11  
3,4c3,4
< E: ID_NET_NAME_ONBOARD=eno33
< E: ID_NET_NAME_PATH=enp99s0f0
---
> E: ID_NET_NAME_ONBOARD=eno33np0
> E: ID_NET_NAME_PATH=enp99s0f0np0
9,10c9,10
< E: ID_NET_NAME_ONBOARD=eno34
< E: ID_NET_NAME_PATH=enp99s0f1
---
> E: ID_NET_NAME_ONBOARD=eno34np1
> E: ID_NET_NAME_PATH=enp99s0f1np1
15,16c15,16
< E: ID_NET_NAME_PATH=enp161s0f0
< E: ID_NET_NAME_SLOT=ens6f0
---
> E: ID_NET_NAME_PATH=enp161s0f0np0
> E: ID_NET_NAME_SLOT=ens6f0np0
21,22c21,22
< E: ID_NET_NAME_PATH=enp161s0f1
< E: ID_NET_NAME_SLOT=ens6f1
---
> E: ID_NET_NAME_PATH=enp161s0f1np1
> E: ID_NET_NAME_SLOT=ens6f1np1

In my case there is no kernel database available for this interfaces. I could fall back to mac but that makes not only very ugly nic names but you need to adapt the config when replacing a NIC, which is another thing that predictable network interface names try to avoid. That is the same when working with MATCH rules and an explicit Name= directive, but it would trade the ugly nic names with configuration overhead.

On a side note if you want to make changes to nic naming, better to create rule files in /etc/systemd/network/ than edit the one in /usr/lib/systemd/network. That is similar to systemd unit files and the like. Otherwise you risk that your files are overwritten by a package installation/update. See man 5 systemd.link.