• Internet sharing/RNDIS Ethernet Gadget issue

    From D.M. Procida@21:1/5 to All on Fri Apr 8 19:33:47 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Graham J@21:1/5 to D.M. Procida on Fri Apr 8 22:12:32 2022
    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?

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bruce Horrocks@21:1/5 to D.M. Procida on Sat Apr 9 13:15:30 2022
    On 08/04/2022 20:33, 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...

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D.M. Procida@21:1/5 to Bruce Horrocks on Sat Apr 9 19:50:57 2022
    On 9 Apr 2022 at 14:15:30 CEST, "Bruce Horrocks" <07.013@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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D.M. Procida@21:1/5 to Graham J on Sat Apr 9 19:41:49 2022
    On 8 Apr 2022 at 23:12:32 CEST, "Graham J" <nobody@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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Graham J@21:1/5 to D.M. Procida on Sat Apr 9 22:06:52 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nospam@21:1/5 to daniele-at-vurt-dot-org@invalid.com on Sat Apr 9 16:17:19 2022
    In article <jbe5rtF9n9tU1@mid.individual.net>, D.M. Procida <daniele-at-vurt-dot-org@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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jaimie Vandenbergh@21:1/5 to Graham J on Sat Apr 9 21:14:23 2022
    On 9 Apr 2022 at 22:06:52 BST, "Graham J" <nobody@nowhere.co.uk> wrote:

    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.

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Graham J@21:1/5 to D.M. Procida on Sat Apr 9 22:04:17 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D.M. Procida@21:1/5 to jaimie@usually.sessile.org on Sun Apr 10 07:35:44 2022
    On 9 Apr 2022 at 23:14:23 CEST, "Jaimie Vandenbergh" <jaimie@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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D.M. Procida@21:1/5 to daniele-at-vurt-dot-org@invalid.com on Sun Apr 10 08:28:47 2022
    On 10 Apr 2022 at 09:35:44 CEST, "D.M. Procida" <daniele-at-vurt-dot-org@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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)