-
Fresh sd card with Raspbian
-
Enable ssh
Add empty file "ssh" to /boot partition on SD card
Add to config.txt
dtoverlay=dwc2
Add to cmd.txt
modules-load=dwc2,g_ether
Edit your /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
Plug in the USB cable from your computer to the "USB" connector port on the Pi Zero, not the PWR connector.
ssh [email protected]
-
RNDIS USB connection to your Raspberry Pi by selecting Manually from the Configure IPv4 menu. Use 192.168.2.1 for the IP Address, and 255.255.255.0 for the Subnet Mask. Click Apply to save your changes.
-
Sharing tab in System Preferences.
Share your connetion from: WiFi Turn on RNDIS Turn on Internet Sharing
Edit your /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo usb0
iface lo inet loopback
iface eth0 inet manual
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
allow-hotplug usb0
iface usb0 inet manual
allow-hotplug usb0
iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.0
network 192.168.7.0
broadcast 192.168.7.255
gateway 192.168.7.1
sudo ifdown usb0
sudo ifup usb0
ifconfig usb0
MacOSX setup:
System Preferences -> Network box
Configure IP4 Manually
For the IP address pick 192.168.7.1 (note that this is not the same as the Pi Zero's address!)
For the subnet mask, use 255.255.255.0 (same as Pi)
For the router/gateway use 192.168.7.1 (same as Pi)
https://learn.adafruit.com/turning-your-raspberry-pi-zero-into-a-usb-gadget/ethernet-tweaks