On 8 Apr 2022 at 23:12:32 CEST, "Graham J" <
nob...@nowhere.co.uk> wrote:
> D.M. Procida wrote:
>> I share an Internet connection to a Raspberry Pi connected via USB.
>>
>> On my MacBook (12.2.1) this works not-entirely-consistently, and right now,
>> not at all.
>>
>> I know it's not the Pi that's problem; it works with other machines.
>>
>> I can reach the Pi via SSH, but it can't see the rest of the world. It has a
>> 169 address on its usb0.
>>
>> I'm not sure whether to blame the Network configuration or Internet Sharing.
>>
>> It's quite maddening. Also a fairly niche configuration...
>
> Does the MacBook have a connection to the router?
Well, yes...
> I imagine your Pi is configued for automatic configuration. This means
> that it tried to find a DHCP server on the network to which it is
> connected. When this fails it allocates itself a 169.x.y.z IP address.
>
> Your MacBook when configured for Internet Connection Sharing should
> behave as a DHCP server for devices connected to its USB port(s). You
> might have to nominate the USB port.
In fact that's not necessary. It's necessary only to nominate the interface,
RNDIS Ethernet Gadget (when it works, anyway).
> Probably the MacBook will relay
> the DHCP request to the upstream DCHP server (your router); that way the
> Pi should get an IP address on the same subnet as the other devices
> conencted to your router. Alternatively the MacBook may create a
> different subnet on the USB port(s) and function as a router, carrying
> traffic between the the two subnets.
Yes, it's the latter, the Macintosh will create a "bridge100" interface, on a
192.x.x.x network (not the same network as its own upstream DCHP server).
> Whatever, once configured
> correctly, it should continue to work.
It should. But it doesn't. Until now it has worked as expected (on the same
MacBook), and as I mentioned, the same Pi is able to pick up its IP address
from other Macs also set for Internet sharing.
> However, I think the Pi should have an Ethernet port. It would be
> possible to connect it directly to your router, so you don't have to
> worry about conenction sharing from your MacBook.
You're right about most Pis, but this one's a Pi Zero, so no Ethernet. For a
Pi Zero, USB gadget mode - i.e. client mode - is most convenient, allowing the
Pi to use its USB port to obtain its network connection.
Daniele