My motherboard originally only have one RJ45 network port. After installed Proxmox VE, ip link shows its name was enp5s0.
Then later I added a new pci-e network card with two SFP+ ports. Then I found I can't access the Proxmox VE server's management interface through the old port. Since it's running as a server without monitors connected, I have to connect a keyboard and monitor to it to figure out why. Then I found after added the new card, ip link shows the old port's name has changed to enp6s0 (the two new nic names are ens6 and ens6d1). But /etc/network/interfaces still uses the old name enp5s0 which does not exist anymore. After changed the name, the problem is resolved.
This causes a bit of trouble and if the added pci-e card fails someday the nic name may be changed back. So I'm wondering can we let /etc/network/interfaces automatically detect and change its name? Or can we use something fixed like MAC address so we do not need to worry about the name changes anymore?
Then later I added a new pci-e network card with two SFP+ ports. Then I found I can't access the Proxmox VE server's management interface through the old port. Since it's running as a server without monitors connected, I have to connect a keyboard and monitor to it to figure out why. Then I found after added the new card, ip link shows the old port's name has changed to enp6s0 (the two new nic names are ens6 and ens6d1). But /etc/network/interfaces still uses the old name enp5s0 which does not exist anymore. After changed the name, the problem is resolved.
This causes a bit of trouble and if the added pci-e card fails someday the nic name may be changed back. So I'm wondering can we let /etc/network/interfaces automatically detect and change its name? Or can we use something fixed like MAC address so we do not need to worry about the name changes anymore?