On Linux-based systems, including NI Linux RT, network interfaces are assigned names (eth0, eth1, eth2, …) in the order that the kernel detects the hardware during boot. When multiple USB-LAN adapters are connected, the detection order is not guaranteed to be consistent across power cycles. As a result:
- Interface names (ethX) may be reassigned differently on each boot
- IP addresses configured per interface can appear to be "swapped"
- NI MAX may still show the original configuration, even though the underlying interface-to-hardware mapping has changed
This behavior typically does not appear when only one USB-LAN adapter is connected, because there is no ambiguity in enumeration order.
To permanently fix the interface mapping, you should assign stable interface names based on MAC addresses using udev rules. This ensures that each physical Ethernet adapter is always recognized with the same interface name, regardless of boot order.
Configuration File
Edit (or create, if empty) the following file on the NI Linux RT target:
/etc/udev/rules.d/80-net-name-slot.rules
Example udev Rules
Map each USB-LAN adapter to a unique and stable interface name using its MAC address:
# Map to stable names using MAC addresses
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:80:2f:19:0c:79", NAME="ethA"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:80:2f:19:0c:3c", NAME="ethB"
*Replace the MAC addresses and interface names to match your environment.
Important Notes and Limitations
- Do not reuse existing names such as eth0, eth1, eth2, or eth3.
- These names are already assigned early in the boot process and cannot be reclaimed.
- Use new, unique names such as
ethA / ethB, lan0 / lan1, or eth5 / eth6.
- MAC addresses must be lowercase and in the format:
- Renaming built-in Ethernet ports (eth0 / eth1) is not recommended.
- If you attempt to rename an interface to a name already in use, udev will fail with a “name already exists” error.