How to Change Proxmox VE Primary NIC When a New Interface is Installed

5
Proxmox VE Change Vmbr0 Network Interfaces To Enp95s0
Proxmox VE Change Vmbr0 Network Interfaces To Enp95s0

In this article, we are going to show you how to change the primary network interface card or NIC for Proxmox VE. This often happens when either the interface name changes due to another configuration change, or there is a new NIC added to or removed from a system. Alternatively, one may simply want to change the NIC that Proxmox VE is using on a multi-NIC system. For experienced Proxmox VE or Linux admins, this is something they have seen before and have a plan for. For those who have never run into it before and are accustomed to managing systems via a web GUI, it can be frustrating. This guide will make quick work of the challenge.

How to Change Proxmox VE Primary NIC When a New Interface is Installed

Here is the setup. We have a system with two 2.5GbE NICs, and two SFP+ NICs. The NIC we used during the installation was a 2.5GbE NIC, and Proxmox VE automatically configured a Linux Bridge (vmbr0) with the interface enp87s0 as the NIC. We can now get to our Proxmox VE system at 10.11.11.3:8006.

Proxmox VE With Four Network Interfaces Enp87s0 As Linux Bridge
Proxmox VE With Four Network Interfaces Enp87s0 As Linux Bridge

Proxmox VE still uses (thank goodness) the /etc/network/interfaces file for networking. One can simply go type

nano /etc/network/interfaces

There nano will allow you to view and edit the network interfaces including vmbr0.

Proxmox VE Enp87s0 In Linux Bridge Port Etc Network Interfaces
Proxmox VE Enp87s0 In Linux Bridge Port Etc Network Interfaces

If we only have that NIC installed, and want an easy way to double-check the link is up then we can simply do:

ethtool enp87s0

Here we can see that we are connected at 2.5GbE speeds and there is an active link.

Proxmox VE Enp87s0 In Ethtool
Proxmox VE Enp87s0 In Ethtool

At this point, we are going to create chaos, and install many NICs. When we do this, enp87s0 will still be on the interface bridge, but the same interface with the cable connected will be renamed.

From a Proxmox VE and Linux perspective, by default it is going to answer requests on port 8006 for the Proxmox VE management interface on the IP address associated with the Linux bridge. Therein lies the problem. The Linux Bridge is using a different interface name now, so there is no longer a link between the bridge and the physical NIC.

Our NIC was renamed to enp95s0 from enp87s0. We can see that this is a linked 2.5GbE NIC again in ethtool.

Proxmox VE Enp95s0 In Ethtool
Proxmox VE Enp95s0 In Ethtool

From here, we can go to the console via IPMI or locally, and go back into

nano /etc/network/interfaces

Here we would change the reference on the Linux Bridge vmbr0 to enp95s0 to match the NIC’s new name:

Proxmox VE Change Vmbr0 Eetc Network Interfaces To Enp95s0
Proxmox VE Change Vmbr0 Eetc Network Interfaces To Enp95s0

Once that id done, we can do a

service network restart

A few seconds later, vmbr0 will be associated with the NICs new Linux interface name and the web UI will respond at the same IP address as it did before.

Proxmox VE Change Vmbr0 Network Interfaces To Enp95s0
Proxmox VE Change Vmbr0 Network Interfaces To Enp95s0

Now we are ready to go.

Final Words

There are many folks who have more complex networking setups. Still, there are many others who end up having a NIC name change and then lose access to their Proxmox VE instance. That can be ultra frustrating. Likewise, if you intended to install Proxmox VE with the default Linux Bridge on a different interface, you can use this to change interfaces and with the last few versions of Proxmox VE, you can even use the web GUI to do so. Just be careful when changing these and make sure you have console access. Most users will have console access when installing a NIC because they will be physically present for the installation.

Overall, this can be very stressful for new Proxmox VE users, but it is actually a super simple fix. If you wanted to use a different IP address instead of an interface, we already have a guide for that in How to Change Primary Proxmox VE IP Address.

5 COMMENTS

  1. Because of the way pcie addressing is handled at boot even adding a m.2 ssd to the machine (let alone other network cards) can screw up the naming of your network and cause the network interface to be unreachable.

    As a workaround I’ve been adding the following for the proxmox interface after install so that a change later doesn’t stop it loading

    Create a file /etc/systemd/network/someName.link with the following contents:
    [Match]
    MACAddress=00:11:22:33:44:55:66

    [Link]
    Name=someProxmoxInterfaceAlias

    #then adding someProxmoxInterfaceAlias to /etc/network/interfaces

  2. I had a BIOS update remapping PCIe devices and network interfaces last tuesday, glad that you wrote a guide on how to change the network interface names (and that goes straight to the point) just in time :)

  3. ProxMox VE is an incredibly good introduction to Linux virtualization and hyperconverged infrastructure. That having been said however, one ought to consider it to be training wheels while you learn to operate the Linux tools natively.

  4. I needed to do this so this was helpful, but the ‘service network restart’ just came up with an unknown service error and a “service –status-all’ didn’t show the network service as being there. Wound up rebooting. Weird thing.

    Used ProxMox years ago and it worked fine even if the GUI was terrible. Giving it another go since the Nutanix CE installation wasn’t working properly for me. It looks to be between ProxMox and Harvester for migrating to away from esxi.

  5. I just used this. The latest Proxmox update caused the add in card ports to be renamed.
    enp2s0f0 became enp2s0f0np0
    enp2s0f1 became enp2s0f1np1

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.