3

I can get the Pi Zero on my Mac's network nicely, using the USB OTG mode. It appears as RNDIS/Ethernet Gadget in the Network preference pane, but annoyingly, each time the Pi reappears after rebooting, it's a new RNDIS/Ethernet Gadget device.

It doesn't take long for the list of interfaces to grow and grow, I must have deleted a hundred or more instances of various numbered RNDIS/Ethernet Gadgets.

I'd really like a Pi to come back as the same device each time.

What is causing this, and is there anything to be done about it?

  • it's your mac that is causing the issue – jsotola Sep 19 at 19:09
  • @jsotola Can you elaborate? – Daniele Procida Sep 19 at 23:08
  • the problem is not with the Radpberry Pi, the problem is with the Mac assigning new device names ... delete your post and create a new one here ... unix.stackexchange.com/questions – jsotola Sep 20 at 0:29
  • 1
    I'm not going to delete the question, many people use the Raspberry Pis with Macintosh systems like this, and it's likely to help someone else in future. It also doesn't look anything like a general Unix issue. – Daniele Procida Sep 20 at 11:23
  • Thank you for not deleting this post: this was exactly the problem I was seeing (and in my case, it had nothing to do with it connecting to a Mac). – Matthew Schinckel Nov 29 at 9:15
3

The issue turns out to be that the Raspberry PI's RNDIS module generates a pair of random MAC addresses for the network each time it starts up.

The host therefore sees a new device attached to its network each time, hence the issue described in the question.

The solution is to set the MAC addresses on the PI rather than allowing them to be set.

The addresses are:

  • host_addr, which is what will be seen by the OTG host
  • dev_addr, the address seen by the OTG device, in this case the Pi

Assuming that you have RNDIS running on the Pi, create a file at: /etc/modprobe.d/rndis.conf. In it, add:

options g_ether host_addr=ae:ad:f5:9d:9f:ba dev_addr=7a:26:9f:3e:97:6c

After this, on every subsequent reboot, the Pi will always appear as ae:ad:f5:9d:9f:ba to your machine.

You can use a random MAC address generator to produce valid MAC addresses for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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