I've been trying to connect my raspberry pi zero over the internet with RNDIS on a mac.

And while it seems very easy on every tutorial, it doesn't work for me.

I will share a few screenshots so you can understand my configuration. enter image description here

enter image description here

enter image description here

So I been able to shh into it and to do some configuration following this tuto

Revisiting the Raspberry Pi Zero WiFi Hacking Gadget

and this one

Turning your Raspberry Pi Zero into a USB Gadget

Because the configuration on tuto didn't work, I started using a different numbers but the idea is the same.

/etc/resolv.conf :

nameserver (also tried with my router address

/etc/network/interfaces :

allow-hotplug usb0
iface usb0 inet static

So this is where I am.

As for now, I cannot connect through ssh anymore no idea why. Something I noticed is while I give it a static IP and while I'm being able to ssh into it, I lose my internet connection on my laptop which I find very weird. Isn't is supposed to share internet?

Thanks for your answers


1 Answer 1


Firstly, undo all your changes to /etc/network/interfaces - if you're making changes here you are following old tutorials (as one of your links suggests) - I wouldn't say never touch anything here, but only do so if you are 100% sure you know what you are doing

Now, edit /etc/dhcpcd.conf and add the following

interface usb0
static ip_address=
static routers=
static domain_name_servers= (or whatever is appropriate to your needs)

This does assume your MAC is set up correctly with IP address for the RNDIS interface - but you've shown nothing regarding that, so I'm speculating that isn't also an issue

  • Thanks for the answer, about the router address it was my actual internet router address so it was not good but I found my Mac IP address, well I think I have. I can ping the pi when I manually give the static ip but cannot ssh into it. With automatic DHCP though, I have now access to internet. I'm not sure to understand what happened here but I will accept this outcome and look more about network configuration, I bought this pi for this after all ! Apr 16, 2021 at 19:07
  • as stated, the "router address" is the MACs RNDIS ip address This does assume your MAC is set up correctly with IP address for the RNDIS interface Apr 16, 2021 at 23:12

Your Answer

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

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