I’m currently doing a Proxmox lab with an old PC of mine, which has a RJ45 NIC on board and a 2-port PCIe card.

Proxmox/Debian uses a predictable naming scheme which is derived from the hardware location of the interface, which can look a little cryptic.

My PCIe NIC has the physical ports labeled LNK A and LNK B

2 port nic

so I wanted to have similar interface names.

Keep in mind that this is for home labbing, future changes in Proxmox might be incompatible. This is what works for me currently:

get existing MAC addresses

With ip -br l show the current NICs with MAC addresses. Mine looked something like this:

root@proxmox:/root# ip -br l 
lo              UNKNOWN        00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP> 
eno0            UP             00:00:00:11:11:11 <BROADCAST,MULTICAST,UP,LOWER_UP> 
enp34s0         DOWN           00:00:00:44:44:44 <BROADCAST,MULTICAST> 
enp33s0f1       DOWN           00:00:00:66:66:66 <BROADCAST,MULTICAST> 
vmbr0           UP             00:00:00:00:00:01 <BROADCAST,MULTICAST,UP,LOWER_UP> 

I really didn’t like the names enp34s0 and enp33s0f1 that’s why I searched for a solution.

My new custom naming scheme

Not sure if this is a bug, but Proxmox shows interfaces as Unknown and not editable when it doesn’t start with en . So that’s why I have every interface start with en_

  • NIC on mainboard

    • en_lnk_main
  • PCIe NIC Port A

    • en_lnk_a
  • PCIe NIC Port B

    • en_lnk_b

As described here in the Debian wiki it’s possible to use .link to specify custom names. For this I created 3 files in /etc/systemd/network

root@proxmox:/etc/systemd/network# ls
00-en_lnk_main.link  10-en_lnk_a.link  20-en_lnk_b.link

00-en_lnk_main

[Match]
MACAddress=00:00:00:11:11:11

[Link]
Name=en_lnk_main

10-en_lnk_a

[Match]
MACAddress=00:00:00:44:44:44

[Link]
Name=en_lnk_a

20-en_lnk_b

[Match]
MACAddress=00:00:00:66:66:66

[Link]
Name=en_lnk_b

Apply changes for regular network configuration

If you skip this step before rebooting, you’ll most likely lose network access!

Now you must change the names in the actual configuration. Replace it with the names you chose in the previous step. Be careful not to forget the interface reference for your bridge-ports.

/etc/network/interfaces

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!

auto lo
iface lo inet loopback

iface en_lnk_a inet manual

iface en_lnk_b inet manual

iface en_lnk_main inet manual

auto vmbr0
iface vmbr0 inet static
	address 10.10.10.123/24
	gateway 10.10.10.1
	bridge-ports en_lnk_main
	bridge-stp off
	bridge-fd 0

For this example I replaced the values on line 15, 17, 19 and 25.

There are different ways to apply the settings without reboot, some are listed at the previously mentioned Debian Wiki, but I usually prefer a clean reboot, just to test if everything works as expected.

Now my inner Monk is happy how this looks 🤓

proxmox-interfaces