2

I want to map each hardware NIC to a specific linux network interface (ethX) persistently, as currently when an ethernet cable is reconnected, it picks an interface seemingly at random. This is trivial with either systemd or udev, but BusyBox does not seem to have a built-in way to do this.

In /sys/class/net, the symlinks from ethX -> ../../devices/platform/soc/XXX.bus/XXX.ethernet/net/ethX never change.

I have tried using nameif, but this only maps MAC -> interface, and the MAC address is hardcoded in u-boot for each ethX, and is not representative of the actual NIC's MAC.

EDIT: This question will remain unanswered for now, because while I still haven't found a reliable way to map NIC -> interface in this embedded BusyBox environment, in my case, the hardware itself is also misbehaving in a way that cannot be solved with software alone.

3
  • can you elaborate what's the issue with nameif? busybox probably doesn't offer anything else.CommentedMar 12, 2024 at 15:05
  • U-Boot has the ethaddr and eth1addr environment variables which provide a mac address for each of the ethX network interfaces in linux, but are not in any way related to the hardware itself. e.g. eth0 will always have the ethaddr MAC address, regardless of its physical NIC.
    – px-wgraj
    CommentedMar 12, 2024 at 15:10
  • 1
    Please edit your question and clarify that your MAC addresses are random and not actually the MAC of the hardware. Maybe also explain why since that seems very strange to me, but I don't know embedded systems. That is essential information that needs to be in the question, not hidden in a comment.
    – terdon
    CommentedMar 13, 2024 at 11:13

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.