I have made a custom board with a WP7607. The board has a USB3503 HSIC USB hub to which two LAN9500 ethernet interfaces are connected. Now when the board is started, eth0 and eth1 are assigned to the ports in a random fashion. I want to statically assign eth0 to the left port and eth1 to the right port.
The left port is connected to USB port 3 and the right one to USB port 2. When I take a look in /sys/class/net I see the following:
I believe it should be possible to assign them the other way around. I can’t find any clear documentation on this unfortunately. Does anyone know how to get this working?
I found a gist on github which seems like it could be helpful. It shows an mdev.conf file which includes a line for renaming interfaces.
-net/.* root:root 600 @/sbin/nameif -s
Unfortunately, nameif is not part of busybox that is enabled in the regular WP images. You would need to rebuild yocto and enable CONFIG_NAMEIF and CONFIG_FEATURE_NAMEIF_EXTENDED. Once you have done that, I think you need to put a /etc/mactab file into the root filesystem with the content:
I’ve found that, too. However this mactab/nameif method seems to name the interfaces by mac address. I’m working the other way around: I read the mac-addresses from two MAC-eeprom chips and write them to the /etc/network/interfaces file (hwaddress ether xx:xx:xx:xx:xx:xx line). So this won’t work for me I guess.
I think the original purpose of nameif was to do it based on mac addr, but in my example above, the rule is based on a bus identifier. I’m not sure what the expected bus identifier would be for your devices though.