How to make network dynamic or sticky ens/enp interfaces on the config file for the bridge?!

en4ble

Member
Feb 24, 2023
73
5
8
Working on some headless deployments.

During the installation I'm using external gpu for the configuration but once completed and gpu is removed the network ID (enp/ens) changes so you are no longer able to access the system.

/etc/network/interfaces by default for default vmbr0 got manual pointer to the physical interface ID (enp/ens) - is there a way to make this sticky so the network ID doesn't change OR make the interface in the configuration file to be dynamic during any physical changes like removal/add of GPU?!

Two pointers we have are iface <interfaceID> inet manual && under the vmbr0 points bridge-port to <interfaceID>

auto lo
iface lo inet loopback
iface enp5s0 inet manual
auto vmbr0
iface vmbr0 inet static
bridge-ports enp5s0
bridge-stp off
bridge-fd 0


I mean you could potentially try blindly go in and change iface enp number and save but thats pain since I don't know whats the new enp pointer after GPU is removed.

Thanks in advance for any advice on this one.