0

Thanks for reading

I had a long question but think I tracked it down correctly. Figured I would post It here anyway for confirmation and to help anyone else looking for this The original shortened question:

I have 2 Pi’s (4) that I am going to use in a test setup. In addition to the on board ethernet connection I have added two USB gigabit ethernet adapters to each Pi. The plan: eth0 on each are connected together, one will be headless and this is my connection to it. Eth1 and eth2 on both are setup as network A(eth1) and B(eth2).

I don't understand how the OS selected the dongles for eth1 and eth2 and I wanted to lock it down so that after any reboot it never changes. I found this on the Ubuntu form, gave it a go, and seems to work

https://askubuntu.com/questions/689501/how-to-rename-network-interface-in-15-10

Summary: Create a file /etc/udev/rules.d/10-rename-network.rules with the content:

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="ff:ff:ff:ff:ff:ff", NAME="eth1"

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="ff:ff:ff:ff:ff:ff", NAME="eth2"

Where ff:ff:ff:ff:ff:ff is the dongle MAC address

save and reboot - seems to work

I still would like to know where in the OS the dongle to eth assignment was originally set if it’s an easy response for anyone Thanks

1
  • So you don't have a problem but are wondering if you implemented it the right way?
    – user96931
    Apr 30, 2020 at 22:45

1 Answer 1

1

The simple answer is you can't, because the order devices are enumerated is unpredictable. The allocation is just on a first come/first served basis. There is NO place it is set. Other platforms have rules based on BIOS provided index numbers or PCI card slot numbers, but this in not applicable to the Pi (or USB dongles in general)

The hard answer is to write udev rules - if you want to do this you will find lots of cryptic documentation.

The easy answer is to enable Predictable Network Interface Names as described in How to set up networking/WiFi This is what MOST Linux/UNIX systems use, but the Foundation has disabled it by default.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.