Recently we noticed that the Linux kernel assignment of physical LAN ports to eth0/1/2 names is not always the same.
- During most boots, the order is (e.g.) LAN1=eth2, LAN2=eth1, LAN3=eth0. But sometimes the order is (e.g.) LAN1=eth2, LAN2=eth0, LAN3=eth1. (Just as an example, there seems to be no port that permanently 'stays in place'.)
- This means that the configured port, e.g. "network_interface=eth1" sometimes has no connection to the network, because the cable is plugged into the hardware port that is normally associated with eth1, but now eth1 is associated to a different physical port.
There must be some hardware that does not change, e.g. the PCI addresses. Could we use this as an order criterium? How?
- I have 'dmesg' and 'ifconfig -a' output I can provide if this is helpful.
- It does not matter if LAN1/2/3 are assigned to some random order, e.g. eth1/2/0, and it does not need to be the same for two different devices (we use a bootcmd script and ifconfig to only enable the configured ethX port). It's only important that on a given Aslan-PC it stays the same on subsequent boots.
- On the 'net, I have found that this is actually a well-known problem - Linux kernels assign ethX names in the order the interfaces are found, and sometimes the detection order changes, depending on which hardware was detected first. On Ubuntu and RedHat, e.g. BIOS-assigned names/numbers can be used, or the 'first boot' situation is locked (using a config file). Of course this is something that might not be possible on a PK installation.
- We do use 'persistent storage' (for the configuration file and browser cache of a PWA, in the future we might have more uses), so storing something locally is an option, and we can probably think up something ourselves (e.g. using some hardware address).
- But maybe someone else had this problem already. Or maybe there is a PK or kernel option, or a script that can already fix this.