[SOLVED] Is there any way to keep the NIC from going down after PCIe change...

PoxyFrogg

New Member
Nov 30, 2023
5
0
1
I need to remove the video card from the system but I know if i do I will loose the NIC.

Is there some way I can prevent that before I remove the video card? Once I do there will be no way for me to access the system.

I sort of understand the problem, that the network interface name changes because of the PCIe device order, or something along those lines. I just do not know enough to fix it.
 
Hi,

you can assign the network interface a fixed name using systemd.link(5)

Create a file named e.g. /etc/systemd/network/90-eth0.link with the following contents:
Code:
[Match]
MACAddress=00:11:22:33:44:55:66

[Link]
Name=foobar
You of course have to replace the MAC address with the actual one from your interface (you can find that out using ip link or ip address).
The name can be something else too of course, although there are some restrictions; see the description of Name= in systemd.link(5).

The important things here are that 1) the MACAddress property is correct and 2) that the files are placed under /etc/systemd/network and ends in .link.

Hope this helps!
 
Well, that did not do it. Creating that file causes the NIC to go down.
Did you also appropriately change /etc/network/interfaces?

Also, what do you mean exactly by that? Not reachable via network? Do you have access to the system in some other way? If yes, please post the output of ip a and /etc/network/interfaces with the above file applied.
 
Yes. Just as you were typing that I was coming to the same answer. I had to update /etc/network/interfaces with the new name.
 
Why is this a problem in the first place? Normally, all NICs have position dependend names like ens0p0 or eno1 and are fixed unless you change the NIC to another pcie slot, at least this is the case for all newer systems (<5y) that I worked with. Maybe a problem with some pcie switch on the mainboard?
 
Another "dirty" solution is to put
Code:
net.ifnames=0 biosdevname=0
in /etc/default/grub

With that we have the "old" ethX interface coming up instead of enpsxsx ....

Very useful with boot on san proxmox with différent hardware configuration...
 
Why is this a problem in the first place? Normally, all NICs have position dependend names like ens0p0 or eno1 and are fixed unless you change the NIC to another pcie slot, at least this is the case for all newer systems (<5y) that I worked with. Maybe a problem with some pcie switch on the mainboard?
Many (consumer?) motherboards assign PCI ID sequentially and adding or removing (or enabling/disabling on-board) PCIe devices causes other devices later in the sequence to get a higher or lower PCI ID (which determines the name of a NIC). Lots of people on the forum have been bitten by this when they added or (re)moved a NVMe storage device.
 
Many (consumer?) motherboards assign PCI ID sequentially and adding or removing (or enabling/disabling on-board) PCIe devices causes other devices later in the sequence to get a higher or lower PCI ID (which determines the name of a NIC). Lots of people on the forum have been bitten by this when they added or (re)moved a NVMe storage device.
Yeah, what I suspected with my "pcie switch" remark. I'm seldomly playing around with non-enterprise hardware.
That's really a pity ... so just using the old non-position names like @Dark26 suggests is therefore much better.
 
PoxyFrogg said:
Yes. Just as you were typing that I was coming to the same answer. I had to update /etc/network/interfaces with the new name.
Great to hear that was the cause and you could solve this!
Please just mark the thread as "SOLVED" by editing the first post, so that others with the same problem can find it more easily in the future! :)

Another "dirty" solution is to put
Code:
net.ifnames=0 biosdevname=0
in /etc/default/grub

With that we have the "old" ethX interface coming up instead of enpsxsx ....
so just using the old non-position names like @Dark26 suggests is therefore much better.
Just as future reference; these old names are not guaranteed to be stable across hardware changes or even reboots(!).
Especially the latter is one of the reasons that prompted for the introduction of the new, address-based naming.

So the best way is really to give them fixed names based on their MAC address.

Consumer hardware vendors (esp. firmware) is unfortunately often just pretty lackluster/bad, as also evidenced by e.g. IOMMU setups for PCIe passthrough.
 
Last edited:
The solution I used on a test system where I was swapping/changing PCie cards and having the NIC change names was to add a udev rule to affix the name to it's MAC address:
Code:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:xx", ATTR{type}=="1", NAME="eno2"
 
Great to hear that was the cause and you could solve this!
Please just mark the thread as "SOLVED" by editing the first post, so that others with the same problem can find it more easily in the future! :)



Just as future reference; these old names are not guaranteed to be stable across hardware changes or even reboots(!).
Especially the latter is one of the reasons that prompted for the introduction of the new, address-based naming.

So the best way is really to give them fixed names based on their MAC address.

Consumer hardware vendors (esp. firmware) is unfortunately often just pretty lackluster/bad, as also evidenced by e.g. IOMMU setups for PCIe passthrough.
If you have multiple network cards, that's true.
 
Just found out: newer Bookworm installs use a interface name derived from the mac address: enxaabbccddeeff, which would also solve all the problems. I wonder when they'll be used in PVE.
 
Hi,

you can assign the network interface a fixed name using systemd.link(5)

Create a file named e.g. /etc/systemd/network/90-eth0.link with the following contents:
Code:
[Match]
MACAddress=00:11:22:33:44:55:66

[Link]
Name=foobar
You of course have to replace the MAC address with the actual one from your interface (you can find that out using ip link or ip address).
The name can be something else too of course, although there are some restrictions; see the description of Name= in systemd.link(5).

The important things here are that 1) the MACAddress property is correct and 2) that the files are placed under /etc/systemd/network and ends in .link.

Hope this helps!
@leesteken and @cheiss Do I need to change anything in /etc/network/interfaces? I can give any name in Name=?
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!