Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Internet sharing/RNDIS Ethernet Gadget issue

522 views
Skip to first unread message

D.M. Procida

unread,
Apr 8, 2022, 3:33:50 PM4/8/22
to
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...

Daniele

Graham J

unread,
Apr 8, 2022, 5:12:50 PM4/8/22
to
Does the MacBook have a connection to the router?

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. 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. Whatever, once configured
correctly, it should continue to work.

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.



--
Graham J

Bruce Horrocks

unread,
Apr 9, 2022, 8:15:34 AM4/9/22
to
Can't help directly but only point you to this bloke who has done it and
it all seems to be pretty straightforward.

<https://www.thepolyglotdeveloper.com/2016/06/connect-raspberry-pi-zero-usb-cable-ssh/>

The two things the article notes are:
- Bonjour needs to be running on the Mac
- the Pi needs to be restarted after enabling connection sharing on the Mac

Not having/doing either of these could result in the 169.x.x.x IP
address that you are seeing.

--
Bruce Horrocks
Surrey, England

D.M. Procida

unread,
Apr 9, 2022, 3:41:52 PM4/9/22
to
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

D.M. Procida

unread,
Apr 9, 2022, 3:50:59 PM4/9/22
to
On 9 Apr 2022 at 14:15:30 CEST, "Bruce Horrocks" <07....@scorecrow.com> 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.

> Can't help directly but only point you to this bloke who has done it and
> it all seems to be pretty straightforward.
>
> <https://www.thepolyglotdeveloper.com/2016/06/connect-raspberry-pi-zero-usb-cable-ssh/>

Indeed, that's the standard way to set up SSH-over-Ethernet-over-USB. That's
working perfectly - what's not working is the Internet sharing part so that
the Pi can access the Internet via the Mac.

I'm going to be reduced to tailing logs on the MacBook for DHCP requests like
some kind of animal.

Daniele

nospam

unread,
Apr 9, 2022, 4:17:23 PM4/9/22
to
In article <jbe5rt...@mid.individual.net>, D.M. Procida
<daniele-at-...@invalid.com> wrote:

> > 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.

a usb-ethernet adapter is the most convenient, especially if it's in
the power adapter.

Graham J

unread,
Apr 9, 2022, 5:04:37 PM4/9/22
to
D.M. Procida wrote:

[snip]

>
>> 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.

[snip]

Does it work reliably from a clean boot of the MacBook?


--
Graham J

Graham J

unread,
Apr 9, 2022, 5:07:13 PM4/9/22
to
D.M. Procida wrote:

[snip]

>
> I'm going to be reduced to tailing logs on the MacBook for DHCP requests like
> some kind of animal.


One would hope there is some sort of log showing the activity of the
"bridge100" interface.


--
Graham J

Jaimie Vandenbergh

unread,
Apr 9, 2022, 5:14:25 PM4/9/22
to
A bit of wireshark-type packet capture on that interface is likely to be
the most useful next move, faffy though it is. macOS's logs are
diabolical these days, I can't find anything useful in them at all -
they seem to have been redesigned for only Apple internal engineering
use.

Cheers - Jaimie
--
"I think man is the most interesting insect on earth, don't you?"
-- Marvin the Martian

D.M. Procida

unread,
Apr 10, 2022, 3:35:46 AM4/10/22
to
On 9 Apr 2022 at 23:14:23 CEST, "Jaimie Vandenbergh"
<jai...@usually.sessile.org> wrote:

>>> I'm going to be reduced to tailing logs on the MacBook for DHCP requests like
>>> some kind of animal.
>>
>>
>> One would hope there is some sort of log showing the activity of the
>> "bridge100" interface.
>
> A bit of wireshark-type packet capture on that interface is likely to be
> the most useful next move, faffy though it is. macOS's logs are
> diabolical these days, I can't find anything useful in them at all -
> they seem to have been redesigned for only Apple internal engineering
> use.

I've been checking the logs whole rebooting the connected Pi (and running
dhclient -d on it, to keep it looking for an IP address).

I may be looking for the wrong things in the macOS Console, but I don't see
anything obviously related).

I expected bootpd to have something to say, but it doesn't emit anything even
when I reconfigure Internet Sharing, which is suspicious.

On the other hand, Jaimie's words are not encouraging...

The last time I know that this worked for certain was 11th March (from Git
logs). I can't remember applying macOS updates since then, but I am
downloading 12.3.1 right now.

Daniele

D.M. Procida

unread,
Apr 10, 2022, 4:28:49 AM4/10/22
to
On 10 Apr 2022 at 09:35:44 CEST, "D.M. Procida"
<daniele-at-...@invalid.com> wrote:

> The last time I know that this worked for certain was 11th March (from Git
> logs). I can't remember applying macOS updates since then, but I am
> downloading 12.3.1 right now.

Guess what?

pi@bgpi:~ $ ifconfig
usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.2.9 netmask 255.255.255.0 broadcast 192.168.2.255

OK, we're back in business after installing 12.3.1.

No idea what went wrong...

Thanks for the tips and suggestions.

Daniele
0 new messages