[SOFT] Pi Zero Ethernet over USB and connection sharing
tl;dr: This is a set of instructions to setup Ethernet over USB setup and connection sharing for the Pi Zero.
Preparing your microSD card
Setting up Ethernet over USB
Once the image has been written to your microSD card, do not eject! Instead:
- Open it in the File Explorer.
- Open
config.txt
at the root of our microSD card with a program that will not mess with the formatting of your file - Em recommends Notepad++.
- Add
dtoverlay=dwc2
at the start of file (under the first commented lines will do).
Open the command.txt
(using the same text editor):
- Add
modules-load=dwc2,g_ether
between rootwait
and quiet
.
- Create an empty file named
ssh
at the root of microSD card to allow SSH connectivity.
Optional: installing drivers
On some computers, Ethernet over USB is not recognized correctly. You can fix that!
- Download drivers from the Domotronic website.
- Find the failing device in the Control Panel's Device Manager - it is usually listed as a failing USB serial connection peripheral in the Ports list.
- Right-click the failing device to Browse your computer for a driver, and select the drivers you downloaded from Domotronic.
Your Pi Zero should now be recognized as a USB Ethernet/RNDIS gadget.
Sharing your Internet connection
The Pi Zero doesn't have an onboard WiFi chip, but you can share your computer's connection with it.
- Go to Settings > Network adapter settings.
- Left-click to select the Pi Zero connection.
- Keep the Shift key pressed, and left click the connection you want to share with the Pi Zero to select.
- With both connections selected, right-click to open the contextual menu.
- Keep the Shift key pressed, and left click the connection you want to share with the Pi Zero to select.
- Select “Bridge connections”.
The connection should be live from your Raspberry Pi within minutes.
You might be tempted to right-click the connection bridge you created and select Disable to stop sharing your connection. Don't: it will actually break your connection to the Internet. Instead:
- Select both the Pi Zero and the Internet connection you are currently sharing.
- Right-click your selections and select “Remove from bridge” from the contextual menu.
Connect your Pi Zero's data USB port to a USB port on your computer with a mini-USB cable. You can now directly connect to it over SSH with your favorite client, using the raspberrypi.local
address.
Extra resources
Send us your Raspberry Pi questions here!