consistent naming of usb nic

G’day,

I have a number of usb->eth dongles each dedicated to a specific subnet. I use interface-name to id the dongle so I can set the correct IP. This usually works, however from time to time the interface name changes and the nm config does not match. Is there a way to consistently find specific nics other than interface-name ?

[connection]
id=usb-nvr-blue-dongle
type=ethernet
autoconnect=true
interface-name=enp0s20f0u6u2u2

permissions=
secondaries=

[ethernet]
mac-address-blacklist=

[ipv4]
address1=192.168.0.202,192.168.0.1
never-default=true
route-metric=2000
method=manual
ignore-auto-routes=true

G’day Thys. The system connection files are Network Manager configs. Here is the reference for the config format. https://developer.gnome.org/NetworkManager/stable/NetworkManager.conf.html

Perhaps you could try a glob match like match-device=interface-name:enp0*.

That would match all nics. The nm manual suggests using the MAC, which in my case is OK. It has a explicit warning against using ifname for USB nics.

Hello Thys,
Can you point us to where the warning has been mentioned on the page regarding the use of ifname. Interested to read more about it, thanks! Glad your problem was resolved.