Enabling USB Ethernet on the Pi0w with an install of LEDE.
It’s a little convoluted and I’m open to learning about optimisations.
I use Win32 Disk Imager, I assume you're already familiar with the image flashing process.
Running the commands.
uci set wireless.radio0.disabled=0
uci commit
reboot
*I originally tried this with the aluminium Apple keyboard (A1243) and the Pi0w refused to recognise it.
The previous commands should have enabled WiFi on the LEDE install and created a new unsecure wireless network called LEDE to connect to.
The following commands can either be entered on the keyboard connected to the Pi or via a SSH session. This loads the drivers for USB Ethernet then shut down the Pi.
opkg update
opkg install kmod-usb-gadget-eth
opkg install kmod-usb-dwc2
halt
At this point the keyboard and monitor should no longer be needed.
With the MicroSD card back in the computer open the config.txt file in the root of the SD card.
At the end of the file add dtoverlay=dwc2
to a new line, save, eject the MicroSD card and reinsert it into the Pi0w.
At this point the Computer should detect the Pi0w as a USB Ethernet device. Once the correct drivers are loaded it should receive an IP address from the DHCP server running on the Pi0w allowing further SSH and LuCI configuration.
Before and after. The original Raspberry Pi Model B made a great portable router but the smaller size and single cable to the computer should make the Raspberry Pi Zero W much more practical. Also configured with a USB WiFi adapter you can choose between USB Ethernet and a WiFi hotspot.
https://lede-project.org/docs/user-guide/usb_gadget
http://www.circuitbasics.com/raspberry-pi-zero-ethernet-gadget/
https://gist.github.com/gbaman/975e2db164b3ca2b51ae11e45e8fd40a
https://forum.lede-project.org/t/raspberry-pi-zero-w-ethernet-gadget-issue/2609
https://lede-project.org/packages/pkgdata/kmod-usb-dwc2
I use my Pi-Router as an ad-blocker and a WiFi hotspot, I found these links useful.
https://github.com/openwrt/packages/tree/master/net/adblock/files
https://forum.lede-project.org/t/adblock-support-thread/507
https://www.andrewklau.com/openwrt-and-a-4-usb-wifi-adapter/
By default when the device boots the usb mac address is randomly generated. This link explains how to add static mac addresses. https://github.com/adron-s/QCA953x-usb-device-mode The file you need to edit is /etc/modules.d/52-usb-gadget-eth