I have 3 different adapters.
2 work as expected, 1 doesn’t. But I don’t know why.
My laptop has 3 usb-c ports, I’ve configured Nixos to give different network settings depending on which usb-c port is used. eg. enp0s20f0u4 enp72s0u1 enp72s0u2
But my new adapter always appends ‘c2’ to the interface name. eg. enp0s20f0u4c2 enp72s0u1c2 enp72s0u2c2
Why?
How can I solve this? I could duplicate my network config for the ‘…c2’, but I’d rather not.
It usually happens because the kernel/systemd predictable naming detects a name collision. When two devices resolve to the same base predictable name (like enp0s20f0u4), systemd will automatically append a suffix such as c2 to keep the interface names unique. Some USB-C Ethernet adapters expose slightly different internal paths (for example through an internal hub or different USB configuration), which can cause the naming logic to treat it as another instance of the same base device.
So in your case the adapter likely resolves to the same predictable name as another interface during enumeration, and systemd renames it to …c2.
A few ways you can handle it:
Create a custom udev rule matching the adapter’s MAC address and assign a fixed name.
Use a .link file in systemd-networkd (or the NixOS equivalent) to match by MAC, driver, or USB path and force a consistent interface name.
If you want to keep port-based behavior, you can match using the USB path (ID_PATH) instead of the generated interface name.
That way you won’t need to duplicate your NixOS network configuration for the c2 variant.
I actually ran into a similar naming quirk recently and found a short explanation referenced on this website while troubleshooting predictable network names.