1

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 8.8.8.8 (also tried with my router address 192.168.0.1)

/etc/network/interfaces :

allow-hotplug usb0
iface usb0 inet static
    address 192.168.0.15
    netmask 255.255.255.0
    network 192.168.0.0
    broadcast 192.168.0.255
    gateway 192.168.0.1

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

0

1 Answer 1

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=192.168.0.15/24
static routers=192.168.0.1
static domain_name_servers=8.8.8.8 (or whatever is appropriate to your needs)

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

2
  • 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 192.168.0.1 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 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.