[SOLVED] network interface name too long

R0b1n

New Member
Mar 14, 2023
10
3
3
I set a vlan tag as 100 for one of the network interfaces of my VM. Then I started it and ran into a bug.
Code:
Error: argument "enp86s0f0np0.100" is wrong: "name" not a valid ifname
can't add vlan tag 100 to interface enp86s0f0np0 - command '/sbin/ip link add link enp86s0f0np0 name enp86s0f0np0.100 type vlan id 100' failed: exit code 255
I found the alphanumeric characters of the network interface "enp86s0f0np0.100" just exceeded 15 which may be prohibited by the system.
Could you please tell me how to handle it so that I can work around it or I can shorten the name at the same time the PVE acknowledge it.
 
Last edited:
You may assign a stable - and short - name as you wish. It is discussed here in the forum several times, Debian - as the base OS - documents it here: https://wiki.debian.org/NetworkInterfaceNames#CUSTOM_SCHEMES_USING_.LINK_FILES
Thank you for the reply. I tried to follow the instructions like this but failed. Nothing changed.
Code:
#/etc/systemd/network/intranet.link
[Match]
MACAddress=b8:ce:f6:32:2a:6e

[Link]
Name=intranet

# udevadm control --reload
# udevadm trigger
# ifreload -a
# systemctl restart networking

Do I have got to restart the server ?
But I hope not to do this because many VMs are running.
 
The problem was finally resolved.
FYI, this is my solution.

【Solution step by step】

// Add systemd.link file as a way of renaming NICs
# cd /etc/systemd/network/

// link file must be shaped like [priority]-[interface-name].link
// the priority is significantly important
// the interface name must be started with "en" so as to be recognized by PVE
// MACAddress is the mac address of the original NIC
// Type=ether makes sure the Debian only modify the name of physical NIC
// Name is the new name of the NIC

# nano 10-enintra.link
Code:
[Match]
MACAddress=b8:ce:f6:32:2a:6e
Type=ether

[Link]
Name=enintra

# nano 10-enouter.link
Code:
[Match]
MACAddress=b8:ce:f6:32:2a:6f
Type=ether

[Link]
Name=enouter

// Update the initramfs
// Copy the link files into the initramfs
# udevadm control --reload
# udevadm trigger
# update-initramfs -u -k all

// replace the items of out-dated network interfaces name with new ones
// So that the items can be reflected to the PVE GUI
// and can be bound to vmbrs
# nano /etc/network/interfaces
Code:
auto lo
iface lo inet loopback

iface enintra inet manual

iface enouter inet manual

iface ens42f1np1 inet manual

iface ens31f0 inet manual

iface ens31f1 inet manual

iface enx62b7708d274b inet manual

iface enp161s0f0np0 inet manual

iface enp161s0f1np1 inet manual

iface ens42f0np0 inet manual

iface enxeaa4d77766e7 inet manual

auto vmbr0
iface vmbr0 inet static
        address 192.168.21.236/24
        gateway 192.168.21.240
        bridge-ports enintra
        bridge-stp off
        bridge-fd 0
#Intranet

auto vmbr1
iface vmbr1 inet static
        address 172.18.6.236/24
        bridge-ports enouter
        bridge-stp off
        bridge-fd 0
#Extranet
 
Last edited:
  • Like
Reactions: UdoB

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!